1
0
Fork 0

Fix composer global config handling

pull/6595/head
Jordi Boggiano 2017-08-08 18:29:20 +02:00 committed by GitHub
parent b0da7db3af
commit c1bbb750c4
1 changed files with 5 additions and 1 deletions

View File

@ -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");
}