From be876b47a940c5ed1caabaa85e58b8fdece807d5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 9 Feb 2024 14:25:53 +0100 Subject: [PATCH] Also output root plugin warning after script execution errors --- src/Composer/Console/Application.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 0679bb46f..709ce6ef8 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -394,6 +394,11 @@ class Application extends BaseApplication return $result; } catch (ScriptExecutionException $e) { + if ($this->getDisablePluginsByDefault() && $this->isRunningAsRoot() && !$this->io->isInteractive()) { + $io->writeError('Plugins have been disabled automatically as you are running as root, this may be the cause of the script failure.', true, IOInterface::QUIET); + $io->writeError('See also https://getcomposer.org/root', true, IOInterface::QUIET); + } + return $e->getCode(); } catch (\Throwable $e) { $ghe = new GithubActionError($this->io);