1
0
Fork 0

For custom composer.json paths the default cwd should be that files directory, fixes ergebnis/composer-normalize#865, refs #10935

pull/10985/head
Jordi Boggiano 2022-07-17 10:22:07 +02:00
parent c5ff1e1fc6
commit 93eb19e756
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 0 deletions

View File

@ -303,6 +303,11 @@ class Factory
*/
public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, $cwd = null, $fullLoad = true, $disableScripts = false)
{
// if a custom composer.json path is given, we change the default cwd to be that file's directory
if (is_string($localConfig) && is_file($localConfig) && null === $cwd) {
$cwd = dirname($localConfig);
}
$cwd = $cwd ?: (string) getcwd();
// load Composer configuration