diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index e51ba1a7ca01..4c1747bda05a 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -185,7 +185,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) $authConfigFile = $input->getOption('global') ? ($this->config->get('home') . '/auth.json') - : dirname(realpath($configFile)) . '/auth.json'; + : dirname(realpath($configFile) !== false ? realpath($configFile) : '') . '/auth.json'; $this->authConfigFile = new JsonFile($authConfigFile, null, $io); $this->authConfigSource = new JsonConfigSource($this->authConfigFile, true);