Skip to content

Commit

Permalink
Fix archive command now that zips are extracted async, refs composer/…
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jul 12, 2021
1 parent db1d9e7 commit b602b19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Composer/Package/Archiver/ArchiveManager.php
Expand Up @@ -16,6 +16,7 @@
use Composer\Package\RootPackageInterface;
use Composer\Util\Filesystem;
use Composer\Util\Loop;
use Composer\Util\SyncHelper;
use Composer\Json\JsonFile;
use Composer\Package\CompletePackageInterface;

Expand Down Expand Up @@ -149,8 +150,9 @@ public function archive(CompletePackageInterface $package, $format, $targetDir,
try {
// Download sources
$promise = $this->downloadManager->download($package, $sourcePath);
$this->loop->wait(array($promise));
$this->downloadManager->install($package, $sourcePath);
SyncHelper::await($this->loop, $promise);
$promise = $this->downloadManager->install($package, $sourcePath);
SyncHelper::await($this->loop, $promise);
} catch (\Exception $e) {
$filesystem->removeDirectory($sourcePath);
throw $e;
Expand Down

0 comments on commit b602b19

Please sign in to comment.