From 6457a88aa18cbc5972d076c46716c12b9f7fa551 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 16 Aug 2022 11:15:52 +0200 Subject: [PATCH] Fix COMPOSER_NO_DEV to work with --update-no-dev for require/remove commands as well, refs #10995 --- src/Composer/Command/BaseCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Command/BaseCommand.php b/src/Composer/Command/BaseCommand.php index 59cbbe9abfb6..2438614f85cb 100644 --- a/src/Composer/Command/BaseCommand.php +++ b/src/Composer/Command/BaseCommand.php @@ -165,6 +165,11 @@ protected function initialize(InputInterface $input, OutputInterface $output) $input->setOption('no-dev', true); } } + if (true == $input->hasOption('update-no-dev')) { + if (!$input->getOption('update-no-dev') && true == Platform::getEnv('COMPOSER_NO_DEV')) { + $input->setOption('update-no-dev', true); + } + } parent::initialize($input, $output); }