From 740bc2fcddbc15e8d04784e830fefde196a609ad Mon Sep 17 00:00:00 2001 From: Leo Feyer <1192057+leofeyer@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:14:59 +0100 Subject: [PATCH] Do not synchronize package.json if symfony/flex is not installed --- src/Flex.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Flex.php b/src/Flex.php index 3d4bff9f..afec54ae 100644 --- a/src/Flex.php +++ b/src/Flex.php @@ -600,6 +600,12 @@ public function finish(string $rootDir, ?string $originalComposerJsonHash = null private function synchronizePackageJson(string $rootDir) { + if (!$this->downloader->isEnabled()) { + $this->io->writeError('Synchronizing package.json is disabled: "symfony/flex" not found in the root composer.json'); + + return; + } + $rootDir = realpath($rootDir); $vendorDir = trim((new Filesystem())->makePathRelative($this->config->get('vendor-dir'), $rootDir), '/');