From 9392adef79bedd1feea7e3053d695850ef5707f1 Mon Sep 17 00:00:00 2001 From: Tehem Date: Tue, 28 Jul 2015 00:01:01 +0200 Subject: [PATCH] Fixes #4302 allow COMPOSER env with config statements (overrides --file) --- src/Composer/Command/ConfigCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index a833a5140..41e9e3766 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -139,7 +139,7 @@ EOT // passed in a file to use $configFile = $input->getOption('global') ? ($this->config->get('home') . '/config.json') - : $input->getOption('file'); + : (trim(getenv('COMPOSER')) ? trim(getenv('COMPOSER')) : $input->getOption('file')); // 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'))) {