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:
commit
33cedda708
2 changed files with 17 additions and 0 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue