From ecc8331312e4850c5f569a8cedc46827dc84bdff Mon Sep 17 00:00:00 2001 From: vitman Date: Sat, 27 Mar 2021 15:23:46 +0300 Subject: [PATCH] Add dev mode env var for scripts run (#9793) Co-authored-by: Vitali Tsyrkin --- src/Composer/Command/RunScriptCommand.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Composer/Command/RunScriptCommand.php b/src/Composer/Command/RunScriptCommand.php index 810325243..c45507b1f 100644 --- a/src/Composer/Command/RunScriptCommand.php +++ b/src/Composer/Command/RunScriptCommand.php @@ -103,6 +103,9 @@ EOT ProcessExecutor::setTimeout((int) $timeout); } + $_SERVER['COMPOSER_DEV_MODE'] = $devMode ? '1' : '0'; + putenv('COMPOSER_DEV_MODE='.$_SERVER['COMPOSER_DEV_MODE']); + return $composer->getEventDispatcher()->dispatchScript($script, $devMode, $args); }