Преглед на файлове

Switch working dir before loading composer, fixes #3146

Jordi Boggiano преди 10 години
родител
ревизия
67a016878e
променени са 1 файла, в които са добавени 6 реда и са изтрити 5 реда
  1. 6 5
      src/Composer/Console/Application.php

+ 6 - 5
src/Composer/Console/Application.php

@@ -104,6 +104,12 @@ class Application extends BaseApplication
             $input->setInteractive(false);
         }
 
+        // switch working dir
+        if ($newWorkDir = $this->getNewWorkingDir($input)) {
+            $oldWorkingDir = getcwd();
+            chdir($newWorkDir);
+        }
+
         // add non-standard scripts as own commands
         if ($composer = $this->getComposer(false)) {
             foreach ($composer->getPackage()->getScripts() as $script => $dummy) {
@@ -118,11 +124,6 @@ class Application extends BaseApplication
             $this->io->enableDebugging($startTime);
         }
 
-        if ($newWorkDir = $this->getNewWorkingDir($input)) {
-            $oldWorkingDir = getcwd();
-            chdir($newWorkDir);
-        }
-
         $result = parent::doRun($input, $output);
 
         if (isset($oldWorkingDir)) {