1
0
Fork 0

Bug in RunScriptCommand::execute()

When checking for known command in commandEvents and scriptEvent '&&' should be used instead of '||'
pull/2837/head
drscre 2014-03-24 13:26:04 +03:00
parent fc9e1d0cff
commit b75beda99c
1 changed files with 1 additions and 1 deletions

View File

@ -69,7 +69,7 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output) protected function execute(InputInterface $input, OutputInterface $output)
{ {
$script = $input->getArgument('script'); $script = $input->getArgument('script');
if (!in_array($script, $this->commandEvents) || !in_array($script, $this->scriptEvents)) { if (!in_array($script, $this->commandEvents) && !in_array($script, $this->scriptEvents)) {
if (defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) { if (defined('Composer\Script\ScriptEvents::'.str_replace('-', '_', strtoupper($script)))) {
throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script)); throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script));
} }