Skip to content

Commit

Permalink
Merge pull request #111 from cyberbit/master
Browse files Browse the repository at this point in the history
Fixes command compatibility issues with Windows
  • Loading branch information
mnapoli committed Jul 20, 2015
2 parents 355b266 + 391b125 commit 5bd90f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/CommandRunner/Git.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ public function getRemoteUrl($remote = 'origin')

private function run($directory, $command)
{
$this->commandRunner->run("cd '$directory' && $command");
$this->commandRunner->run("cd \"$directory\" && $command");
}
}
8 changes: 4 additions & 4 deletions tests/UnitTest/CommandRunner/GitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function clone_should_run_git_clone()
*/
public function checkout_origin_branch_should_run_git_checkout()
{
$this->expectCommandIsRun("cd 'directory' && git checkout -b branch origin/branch");
$this->expectCommandIsRun("cd \"directory\" && git checkout -b branch origin/branch");

$this->git->checkoutOriginBranch('directory', 'branch');
}
Expand All @@ -54,7 +54,7 @@ public function checkout_origin_branch_should_run_git_checkout()
*/
public function create_branch_should_run_git_checkout()
{
$this->expectCommandIsRun("cd 'directory' && git checkout -b branch");
$this->expectCommandIsRun("cd \"directory\" && git checkout -b branch");

$this->git->createBranch('directory', 'branch');
}
Expand All @@ -64,7 +64,7 @@ public function create_branch_should_run_git_checkout()
*/
public function commit_should_run_git_add_and_commit()
{
$this->expectCommandIsRun("cd 'directory' && git add --all . && git commit -m 'message'");
$this->expectCommandIsRun("cd \"directory\" && git add --all . && git commit -m 'message'");

$this->git->commitAllChanges('directory', 'message');
}
Expand All @@ -74,7 +74,7 @@ public function commit_should_run_git_add_and_commit()
*/
public function push_should_run_git_push()
{
$this->expectCommandIsRun("cd 'directory' && git push my-remote branch");
$this->expectCommandIsRun("cd \"directory\" && git push my-remote branch");

$this->git->push('directory', 'branch', 'my-remote');
}
Expand Down

0 comments on commit 5bd90f2

Please sign in to comment.