Browse Source

Skip all scripts and not just command ones

Jordi Boggiano 12 năm trước cách đây
mục cha
commit
e25ccddeb7
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Composer/Installer.php

+ 2 - 2
src/Composer/Installer.php

@@ -367,7 +367,7 @@ class Installer
 
 
             if (!$this->dryRun) {
             if (!$this->dryRun) {
                 $event = 'Composer\Script\ScriptEvents::PRE_PACKAGE_'.strtoupper($operation->getJobType());
                 $event = 'Composer\Script\ScriptEvents::PRE_PACKAGE_'.strtoupper($operation->getJobType());
-                if (defined($event)) {
+                if (defined($event) && $this->runScripts) {
                     $this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
                     $this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
                 }
                 }
 
 
@@ -407,7 +407,7 @@ class Installer
                 $this->installationManager->execute($localRepo, $operation);
                 $this->installationManager->execute($localRepo, $operation);
 
 
                 $event = 'Composer\Script\ScriptEvents::POST_PACKAGE_'.strtoupper($operation->getJobType());
                 $event = 'Composer\Script\ScriptEvents::POST_PACKAGE_'.strtoupper($operation->getJobType());
-                if (defined($event)) {
+                if (defined($event) && $this->runScripts) {
                     $this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
                     $this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
                 }
                 }