1
0
Fork 0

Fix run-script --list failing to handle native script handlers, fixes #7069

pull/7096/merge
Jordi Boggiano 2018-04-12 10:39:18 +02:00
parent 4bddcd7124
commit ec9ba46c5f
1 changed files with 7 additions and 3 deletions

View File

@ -114,11 +114,15 @@ EOT
$io->writeError('<info>scripts:</info>'); $io->writeError('<info>scripts:</info>');
$table = array(); $table = array();
foreach ($scripts as $name => $script) { foreach ($scripts as $name => $script) {
$cmd = $this->getApplication()->find($name);
$description = ''; $description = '';
try {
$cmd = $this->getApplication()->find($name);
if ($cmd instanceof ScriptAliasCommand) { if ($cmd instanceof ScriptAliasCommand) {
$description = $cmd->getDescription(); $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); $table[] = array(' '.$name, $description);
} }