1
0
Fork 0

Fix handling of promises for uninstall step when updating to a different install source

pull/9702/head
Jordi Boggiano 2021-02-10 10:03:44 +01:00
parent 28bc0cecf1
commit 78d7792eb8
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 2 deletions

View File

@ -492,9 +492,15 @@ class InstallationManager
$promise = $installer->update($repo, $initial, $target); $promise = $installer->update($repo, $initial, $target);
$this->markForNotification($target); $this->markForNotification($target);
} else { } else {
$this->getInstaller($initialType)->uninstall($repo, $initial); $promise = $this->getInstaller($initialType)->uninstall($repo, $initial);
if (!$promise instanceof PromiseInterface) {
$promise = \React\Promise\resolve();
}
$installer = $this->getInstaller($targetType); $installer = $this->getInstaller($targetType);
$promise = $installer->install($repo, $target); $promise->then(function () use ($installer, $repo, $target) {
return $installer->install($repo, $target);
});
} }
return $promise; return $promise;