1
0
Fork 0

Also output root plugin warning after script execution errors

pull/11844/head
Jordi Boggiano 2024-02-09 14:25:53 +01:00
parent 9acf6bc0a1
commit be876b47a9
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 5 additions and 0 deletions

View File

@ -394,6 +394,11 @@ class Application extends BaseApplication
return $result; return $result;
} catch (ScriptExecutionException $e) { } catch (ScriptExecutionException $e) {
if ($this->getDisablePluginsByDefault() && $this->isRunningAsRoot() && !$this->io->isInteractive()) {
$io->writeError('<error>Plugins have been disabled automatically as you are running as root, this may be the cause of the script failure.</error>', true, IOInterface::QUIET);
$io->writeError('<error>See also https://getcomposer.org/root</error>', true, IOInterface::QUIET);
}
return $e->getCode(); return $e->getCode();
} catch (\Throwable $e) { } catch (\Throwable $e) {
$ghe = new GithubActionError($this->io); $ghe = new GithubActionError($this->io);