diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 310507a53..8f40cfb06 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -609,16 +609,6 @@ class Installer $this->io->writeError('Writing lock file'); } - // see https://github.com/composer/composer/issues/2764 - if ($this->executeOperations && count($lockTransaction->getOperations()) > 0) { - $vendorDir = $this->config->get('vendor-dir'); - if (is_dir($vendorDir)) { - // suppress errors as this fails sometimes on OSX for no apparent reason - // see https://github.com/composer/composer/issues/4070#issuecomment-129792748 - @touch($vendorDir); - } - } - if ($doInstall) { // TODO ensure lock is used from locker as-is, since it may not have been written to disk in case of executeOperations == false return $this->doInstall($localRepo, true); @@ -797,6 +787,16 @@ class Installer if ($this->executeOperations) { $localRepo->setDevPackageNames($this->locker->getDevPackageNames()); $this->installationManager->execute($localRepo, $localRepoTransaction->getOperations(), $this->devMode, $this->runScripts, $this->downloadOnly); + + // see https://github.com/composer/composer/issues/2764 + if (count($localRepoTransaction->getOperations()) > 0) { + $vendorDir = $this->config->get('vendor-dir'); + if (is_dir($vendorDir)) { + // suppress errors as this fails sometimes on OSX for no apparent reason + // see https://github.com/composer/composer/issues/4070#issuecomment-129792748 + @touch($vendorDir); + } + } } else { foreach ($localRepoTransaction->getOperations() as $operation) { // output op, but alias op only in debug verbosity