Skip to content

Commit

Permalink
Force CreateProjectCommand to use the installed composer.json (#11493)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jun 7, 2023
1 parent 44c5e2e commit ebd0a60
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Composer/Command/CreateProjectCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,13 @@ protected function installRootPackage(IOInterface $io, Config $config, string $p
$io->writeError('<info>Created project in ' . $directory . '</info>');
chdir($directory);

// 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');
}

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

// once the root project is fully initialized, we do not need to wipe everything on user abort anymore even if it happens during deps install
Expand Down

0 comments on commit ebd0a60

Please sign in to comment.