Skip to content

Commit 0491870

Browse files
committed
bug #1039 Do not synchronize package.json if symfony/flex is not installed (leofeyer)
This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead. Discussion ---------- Do not synchronize package.json if symfony/flex is not installed Just as the project is not configured and no recipes are loaded if symfony/flex is not in the root `composer.json`, the `package.json` should not be synchronized in this case. Commits ------- 740bc2f Do not synchronize package.json if symfony/flex is not installed
2 parents 1aabc8e + 740bc2f commit 0491870

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Flex.php

+6
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,12 @@ public function finish(string $rootDir, ?string $originalComposerJsonHash = null
600600

601601
private function synchronizePackageJson(string $rootDir)
602602
{
603+
if (!$this->downloader->isEnabled()) {
604+
$this->io->writeError('<warning>Synchronizing package.json is disabled: "symfony/flex" not found in the root composer.json</>');
605+
606+
return;
607+
}
608+
603609
$rootDir = realpath($rootDir);
604610
$vendorDir = trim((new Filesystem())->makePathRelative($this->config->get('vendor-dir'), $rootDir), '/');
605611

0 commit comments

Comments
 (0)