Browse Source

Don't mutate cwd.

Running composer dumpautoload should not mutate cwd.

Refs #5011
mark_story 11 years ago
parent
commit
9b4ea64a1a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/Shell/Task/PluginTask.php

+ 5 - 0
src/Shell/Task/PluginTask.php

@@ -264,9 +264,14 @@ class PluginTask extends BakeTask {
 		}
 
 		try {
+			$cwd = getcwd();
+
+			// Windows makes running multiple commands at once hard.
 			chdir($path);
 			$command = 'php ' . escapeshellarg($composer) . ' dump-autoload';
 			$this->callProcess($command);
+
+			chdir($cwd);
 		} catch (\RuntimeException $e) {
 			$error = $e->getMessage();
 			$this->error(sprintf('Could not run `composer dump-autoload`: %s', $error));