Browse Source

Merge branch '1.1'

Jordi Boggiano 8 years ago
parent
commit
827d52cccf
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/Composer/Console/Application.php

+ 7 - 7
src/Composer/Console/Application.php

@@ -110,6 +110,13 @@ class Application extends BaseApplication
         $io = $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
         ErrorHandler::register($io);
 
+        // switch working dir
+        if ($newWorkDir = $this->getNewWorkingDir($input)) {
+            $oldWorkingDir = getcwd();
+            chdir($newWorkDir);
+            $io->writeError('Changed CWD to ' . getcwd(), true, IOInterface::DEBUG);
+        }
+
         // determine command name to be executed without including plugin commands
         $commandName = '';
         if ($name = $this->getCommandName($input)) {
@@ -189,13 +196,6 @@ class Application extends BaseApplication
                 }
             });
 
-            // switch working dir
-            if ($newWorkDir = $this->getNewWorkingDir($input)) {
-                $oldWorkingDir = getcwd();
-                chdir($newWorkDir);
-                $io->writeError('Changed CWD to ' . getcwd(), true, IOInterface::DEBUG);
-            }
-
             // add non-standard scripts as own commands
             $file = Factory::getComposerFile();
             if (is_file($file) && is_readable($file) && is_array($composer = json_decode(file_get_contents($file), true))) {