1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 09:32:55 +00:00

Merge remote-tracking branch 'MaxGfeller/run-script-enhancement'

This commit is contained in:
Jordi Boggiano 2014-07-20 19:07:45 +02:00
commit 33cedda708
2 changed files with 17 additions and 0 deletions

View file

@ -73,7 +73,11 @@ EOT
if (defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {
throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script));
}
}
$hasListeners = $this->getComposer()->getEventDispatcher()->hasEventListeners(new \Composer\Script\CommandEvent($script, $this->getComposer(), $this->getIO()));
if(!$hasListeners) {
throw new \InvalidArgumentException(sprintf('Script "%s" does not exist', $script));
}