Skip to content

Commit

Permalink
Improve declinating composer.lock into symfony.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Apr 30, 2022
1 parent 64d2f3b commit ec578e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
$composer->setRepositoryManager($manager);
}

$composerFile = Factory::getComposerFile();
$composerLock = 'json' === pathinfo($composerFile, \PATHINFO_EXTENSION) ? substr($composerFile, 0, -4).'lock' : $composerFile.'.lock';
$symfonyLock = str_replace('composer', 'symfony', basename($composerLock));

$this->configurator = new Configurator($composer, $io, $this->options);
$this->lock = new Lock(getenv('SYMFONY_LOCKFILE') ?: str_replace('composer.json', 'symfony.lock', Factory::getComposerFile()));
$this->lock = new Lock(getenv('SYMFONY_LOCKFILE') ?: \dirname($composerLock).'/'.(basename($composerLock) !== $symfonyLock ? $symfonyLock : 'symfony.lock'));

$disable = true;
foreach (array_merge($composer->getPackage()->getRequires() ?? [], $composer->getPackage()->getDevRequires() ?? []) as $link) {
Expand Down

0 comments on commit ec578e9

Please sign in to comment.