1
0
Fork 0

Fix dry run skipping some critical steps

pull/727/head
Jordi Boggiano 2012-05-23 15:16:24 +02:00
parent 1095d84256
commit 63d7abf196
1 changed files with 46 additions and 43 deletions

View File

@ -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();
}
}