Skip to content

Commit

Permalink
Use chdir() instead of calling multiple commands.
Browse files Browse the repository at this point in the history
This improves compatibility with windows, and continues to work on *nix
systems.

Refs #5011
  • Loading branch information
markstory committed Oct 30, 2014
1 parent 609ca19 commit 31cd0ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Shell/Task/PluginTask.php
Expand Up @@ -264,8 +264,8 @@ protected function _modifyAutoloader($plugin, $path) {
}

try {
$command = 'cd ' . escapeshellarg($path) . '; ';
$command .= 'php ' . escapeshellarg($composer) . ' dump-autoload';
chdir($path);
$command = 'php ' . escapeshellarg($composer) . ' dump-autoload';
$this->callProcess($command);
} catch (\RuntimeException $e) {
$error = $e->getMessage();
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Shell/Task/PluginTaskTest.php
Expand Up @@ -200,7 +200,7 @@ public function testExecuteUpdateComposer() {

$this->Task->expects($this->at(3))
->method('callProcess')
->with('cd ' . escapeshellarg($path) . '; php ' . escapeshellarg('composer.phar') . ' dump-autoload');
->with('php ' . escapeshellarg('composer.phar') . ' dump-autoload');

$this->Task->main('BakeTestPlugin');

Expand Down

0 comments on commit 31cd0ff

Please sign in to comment.