Skip to content

Add support for Windows #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 25, 2017
Merged

Add support for Windows #8

merged 8 commits into from
Jul 25, 2017

Conversation

iPaat
Copy link
Contributor

@iPaat iPaat commented Jul 25, 2017

This will:

  • extend .gitignore for JetBrain users
  • fix tests for windows
  • use native PHP functions instead of passthru
  • fix src/Commands/AddCommand.php to use findstr on windows instead of grep
  • add SHEBANG to hook files on windows
  • test that the SHEBANG has been added on windows
  • fix Hooks on Windows environment #7

@@ -37,7 +37,13 @@ public function it_lists_hooks_that_exist()
public function it_uses_a_different_git_path_if_specified()
{
$gitDir = 'test-git-dir';
passthru("mkdir -p {$gitDir}/hooks");

$command = "mkdir -p {$gitDir}/hooks";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know what, could we just use the mkdir function? I should've done that in the first place. It would be much better.

@BrainMaestro
Copy link
Owner

Hey thanks for doing this! It looks pretty good.

@iPaat
Copy link
Contributor Author

iPaat commented Jul 25, 2017

Thank you for your feedback.

I have adjusted everything so far that only native PHP functions will be used in future.

@BrainMaestro
Copy link
Owner

Hey that's way better than I thought. Thanks for this

@BrainMaestro BrainMaestro merged commit 3eb176a into BrainMaestro:master Jul 25, 2017
@iPaat iPaat deleted the Enhancement/PrepareForWindows branch July 26, 2017 08:37
public function it_adds_shebang_to_hooks_on_windows()
{
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
$this->markTestSkipped('This test is only relevant on windows. You\'re running Linux.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I am not. I'm on macOS ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hooks on Windows environment
3 participants