Skip to content

Commit 9344f44

Browse files
committed
[BUGFIX] Correct extension update for composer 2
1 parent 5a13b29 commit 9344f44

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Installer/ExtensionInstaller.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ public function update(InstalledRepositoryInterface $repo, PackageInterface $ini
196196
if ($promise instanceof PromiseInterface) {
197197
$binaryInstaller = $this->binaryInstaller;
198198
$installPath = $this->getInstallPath($target);
199-
return $promise->then(function () use ($binaryInstaller, $installPath, $package, $repo) {
200-
$binaryInstaller->installBinaries($package, $installPath);
201-
if (!$repo->hasPackage($package)) {
202-
$repo->addPackage(clone $package);
199+
return $promise->then(function () use ($binaryInstaller, $installPath, $target, $initial, $repo) {
200+
$binaryInstaller->installBinaries($target, $installPath);
201+
$repo->removePackage($initial);
202+
if (!$repo->hasPackage($target)) {
203+
$repo->addPackage(clone $target);
203204
}
204205
});
205206
}

0 commit comments

Comments
 (0)