From 14e8b371ae95dbc4b3916cc87f5388de048f2d9d Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Mon, 30 Jun 2025 20:13:26 +0100 Subject: [PATCH] 272: do not clean up for download and build commands --- src/Command/BuildCommand.php | 1 + src/Command/DownloadCommand.php | 1 + src/Command/InstallCommand.php | 1 + src/ComposerIntegration/ComposerIntegrationHandler.php | 5 +++++ 4 files changed, 8 insertions(+) diff --git a/src/Command/BuildCommand.php b/src/Command/BuildCommand.php index fd5588fa..e6047323 100644 --- a/src/Command/BuildCommand.php +++ b/src/Command/BuildCommand.php @@ -91,6 +91,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $targetPlatform, $requestedNameAndVersion, $forceInstallPackageVersion, + false, ); } catch (ComposerRunFailed $composerRunFailed) { $output->writeln('' . $composerRunFailed->getMessage() . ''); diff --git a/src/Command/DownloadCommand.php b/src/Command/DownloadCommand.php index 9c156459..8a32f2ed 100644 --- a/src/Command/DownloadCommand.php +++ b/src/Command/DownloadCommand.php @@ -75,6 +75,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $targetPlatform, $requestedNameAndVersion, $forceInstallPackageVersion, + false, ); } catch (ComposerRunFailed $composerRunFailed) { $output->writeln('' . $composerRunFailed->getMessage() . ''); diff --git a/src/Command/InstallCommand.php b/src/Command/InstallCommand.php index fd2c8fde..7fe8c4cf 100644 --- a/src/Command/InstallCommand.php +++ b/src/Command/InstallCommand.php @@ -106,6 +106,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $targetPlatform, $requestedNameAndVersion, $forceInstallPackageVersion, + true, ); } catch (ComposerRunFailed $composerRunFailed) { $output->writeln('' . $composerRunFailed->getMessage() . ''); diff --git a/src/ComposerIntegration/ComposerIntegrationHandler.php b/src/ComposerIntegration/ComposerIntegrationHandler.php index 4c51f724..aabf702a 100644 --- a/src/ComposerIntegration/ComposerIntegrationHandler.php +++ b/src/ComposerIntegration/ComposerIntegrationHandler.php @@ -32,6 +32,7 @@ public function runInstall( TargetPlatform $targetPlatform, RequestedPackageAndVersion $requestedPackageAndVersion, bool $forceInstallPackageVersion, + bool $runCleanup, ): void { $versionSelector = VersionSelectorFactory::make($composer, $requestedPackageAndVersion, $targetPlatform); @@ -86,6 +87,10 @@ public function runInstall( throw ComposerRunFailed::fromExitCode($resultCode); } + if (! $runCleanup) { + return; + } + ($this->vendorCleanup)($composer); }