1
0
Fork 0

Fix archive command now that zips are extracted async, refs composer/satis#655

pull/9996/head
Jordi Boggiano 2021-07-12 15:09:59 +02:00
parent db1d9e75be
commit b602b19f6d
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 2 deletions

View File

@ -16,6 +16,7 @@ use Composer\Downloader\DownloadManager;
use Composer\Package\RootPackageInterface; use Composer\Package\RootPackageInterface;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Loop; use Composer\Util\Loop;
use Composer\Util\SyncHelper;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\Package\CompletePackageInterface; use Composer\Package\CompletePackageInterface;
@ -149,8 +150,9 @@ class ArchiveManager
try { try {
// Download sources // Download sources
$promise = $this->downloadManager->download($package, $sourcePath); $promise = $this->downloadManager->download($package, $sourcePath);
$this->loop->wait(array($promise)); SyncHelper::await($this->loop, $promise);
$this->downloadManager->install($package, $sourcePath); $promise = $this->downloadManager->install($package, $sourcePath);
SyncHelper::await($this->loop, $promise);
} catch (\Exception $e) { } catch (\Exception $e) {
$filesystem->removeDirectory($sourcePath); $filesystem->removeDirectory($sourcePath);
throw $e; throw $e;