From ec9ba46c5f6ba537bc11a2f33d6c4483252c564c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 12 Apr 2018 10:39:18 +0200 Subject: [PATCH] Fix run-script --list failing to handle native script handlers, fixes #7069 --- src/Composer/Command/RunScriptCommand.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Composer/Command/RunScriptCommand.php b/src/Composer/Command/RunScriptCommand.php index d78662e23..3d392c491 100644 --- a/src/Composer/Command/RunScriptCommand.php +++ b/src/Composer/Command/RunScriptCommand.php @@ -114,10 +114,14 @@ EOT $io->writeError('scripts:'); $table = array(); foreach ($scripts as $name => $script) { - $cmd = $this->getApplication()->find($name); $description = ''; - if ($cmd instanceof ScriptAliasCommand) { - $description = $cmd->getDescription(); + try { + $cmd = $this->getApplication()->find($name); + if ($cmd instanceof ScriptAliasCommand) { + $description = $cmd->getDescription(); + } + } catch (\Symfony\Component\Console\Exception\CommandNotFoundException $e) { + // ignore scripts that have no command associated, like native Composer script listeners } $table[] = array(' '.$name, $description); }