1
0
Fork 0

Fix composer status command handling of failed promises, closes #11889

pull/11795/head
Jordi Boggiano 2024-03-20 10:47:52 +01:00
parent 7e9bc82017
commit 5a1d506c77
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 15 additions and 3 deletions

View File

@ -495,10 +495,22 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$this->filesystem->removeDirectory($targetDir.'_compare');
}
$this->download($package, $targetDir.'_compare', null, false);
$promise = $this->download($package, $targetDir.'_compare', null, false);
$promise->catch(function ($ex) use (&$e) {
$e = $ex;
});
$this->httpDownloader->wait();
$this->install($package, $targetDir.'_compare', false);
if ($e !== null) {
throw $e;
}
$promise = $this->install($package, $targetDir.'_compare', false);
$promise->catch(function ($ex) use (&$e) {
$e = $ex;
});
$this->process->wait();
if ($e !== null) {
throw $e;
}
$comparer = new Comparer();
$comparer->setSource($targetDir.'_compare');
@ -511,7 +523,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$this->io = $prevIO;
if ($e) {
if ($e !== null) {
throw $e;
}