From 89f057e0df965020dcac4102a1a0a099eab66707 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 15 Apr 2024 11:49:04 +0200 Subject: [PATCH] Ensure we clear the locally configured cache dir instead of default one, fixes #11921 --- src/Composer/Command/ClearCacheCommand.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/ClearCacheCommand.php b/src/Composer/Command/ClearCacheCommand.php index 028aa4212..77ed517a8 100644 --- a/src/Composer/Command/ClearCacheCommand.php +++ b/src/Composer/Command/ClearCacheCommand.php @@ -45,7 +45,13 @@ EOT protected function execute(InputInterface $input, OutputInterface $output): int { - $config = Factory::createConfig(); + $composer = $this->tryComposer(); + if ($composer !== null) { + $config = $composer->getConfig(); + } else { + $config = Factory::createConfig(); + } + $io = $this->getIO(); $cachePaths = [