Fix dry run skipping some critical steps
parent
1095d84256
commit
63d7abf196
|
@ -130,6 +130,7 @@ class Installer
|
|||
{
|
||||
if ($this->dryRun) {
|
||||
$this->verbose = true;
|
||||
$this->runScripts = false;
|
||||
}
|
||||
|
||||
if ($this->preferSource) {
|
||||
|
@ -151,7 +152,7 @@ class Installer
|
|||
|
||||
$aliases = $this->aliasPackages();
|
||||
|
||||
if (!$this->dryRun && $this->runScripts) {
|
||||
if ($this->runScripts) {
|
||||
// dispatch pre event
|
||||
$eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
|
||||
$this->eventDispatcher->dispatchCommandEvent($eventName);
|
||||
|
@ -365,7 +366,6 @@ class Installer
|
|||
}
|
||||
}
|
||||
|
||||
if (!$this->dryRun) {
|
||||
$event = 'Composer\Script\ScriptEvents::PRE_PACKAGE_'.strtoupper($operation->getJobType());
|
||||
if (defined($event) && $this->runScripts) {
|
||||
$this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
|
||||
|
@ -404,13 +404,16 @@ class Installer
|
|||
}
|
||||
}
|
||||
|
||||
if (!$this->dryRun) {
|
||||
$this->installationManager->execute($localRepo, $operation);
|
||||
}
|
||||
|
||||
$event = 'Composer\Script\ScriptEvents::POST_PACKAGE_'.strtoupper($operation->getJobType());
|
||||
if (defined($event) && $this->runScripts) {
|
||||
$this->eventDispatcher->dispatchPackageEvent(constant($event), $operation);
|
||||
}
|
||||
|
||||
if (!$this->dryRun) {
|
||||
$localRepo->write();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue