Преглед на файлове

Bug in RunScriptCommand::execute()

When checking for known command in commandEvents and scriptEvent '&&' should be used instead of '||'
drscre преди 11 години
родител
ревизия
b75beda99c
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/Composer/Command/RunScriptCommand.php

+ 1 - 1
src/Composer/Command/RunScriptCommand.php

@@ -69,7 +69,7 @@ EOT
     protected function execute(InputInterface $input, OutputInterface $output)
     {
         $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)))) {
                 throw new \InvalidArgumentException(sprintf('Script "%s" cannot be run with this command', $script));
             }