Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Composer/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,16 +607,6 @@ protected function doUpdate(InstalledRepositoryInterface $localRepo, bool $doIns
$this->io->writeError('<info>Writing lock file</info>');
}

// 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);
Expand Down Expand Up @@ -795,6 +785,16 @@ protected function doInstall(InstalledRepositoryInterface $localRepo, bool $alre
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
Expand Down