瀏覽代碼

use Factory::getComposerFile in ConfigCommand

David Zuelke 7 年之前
父節點
當前提交
ae7c076a7c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Command/ConfigCommand.php

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

@@ -146,7 +146,7 @@ EOT
         // passed in a file to use
         $configFile = $input->getOption('global')
             ? ($this->config->get('home') . '/config.json')
-            : ($input->getOption('file') ?: trim(getenv('COMPOSER')) ?: 'composer.json');
+            : ($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'))) {