Sfoglia il codice sorgente

Fix composer global config handling

Jordi Boggiano 7 anni fa
parent
commit
c1bbb750c4
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/Composer/Command/ConfigCommand.php

+ 5 - 1
src/Composer/Command/ConfigCommand.php

@@ -149,7 +149,11 @@ EOT
             : ($input->getOption('file') ?: Factory::getComposerFile());
 
         // Create global composer.json if this was invoked using `composer global config`
-        if ($configFile === 'composer.json' && !file_exists($configFile) && realpath(getcwd()) === realpath($this->config->get('home'))) {
+        if (
+            ($configFile === 'composer.json' || $configFile === './composer.json')
+            && !file_exists($configFile)
+            && realpath(getcwd()) === realpath($this->config->get('home'))
+        ) {
             file_put_contents($configFile, "{\n}\n");
         }