Skip to content

Commit

Permalink
Avoid COMPOSER env being set if not necessary as it can cause issues …
Browse files Browse the repository at this point in the history
…with scripts, fixes #11613, refs #11493
  • Loading branch information
Seldaek committed Sep 3, 2023
1 parent 90cbb14 commit 98a588e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Composer/Command/CreateProjectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,8 @@ protected function installRootPackage(IOInterface $io, Config $config, string $p
// ensure that the env var being set does not interfere with create-project
// as it is probably not meant to be used here, so we do not use it if a composer.json can be found
// in the project
if (file_exists($directory.'/composer.json')) {
Platform::putEnv('COMPOSER', $directory.'/composer.json');
if (file_exists($directory.'/composer.json') && Platform::getEnv('COMPOSER') !== false) {
Platform::clearEnv('COMPOSER');
}

Platform::putEnv('COMPOSER_ROOT_VERSION', $package->getPrettyVersion());
Expand Down

0 comments on commit 98a588e

Please sign in to comment.