1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 17:12:51 +00:00

Check if a given event has registered any listeners. If not the script

is not defined in the composer.json file
This commit is contained in:
Max Gfeller 2013-12-19 08:46:36 +01:00
parent f1c1ba27b4
commit 421b09dc44

View file

@ -58,6 +58,12 @@ EOT
}
}
$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));
}
$this->getComposer()->getEventDispatcher()->dispatchCommandEvent($script, $input->getOption('dev') || !$input->getOption('no-dev'));
}
}