Fix status command bug

main
Jordi Boggiano 4 years ago
parent 0d369c87bc
commit 09fc263d37
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -29,7 +29,7 @@ abstract class ArchiveDownloader extends FileDownloader
{ {
public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null, $output = true) public function download(PackageInterface $package, $path, PackageInterface $prevPackage = null, $output = true)
{ {
// if not downgrading and the dir already exists it seems we have an inconsistent state in the vendor dir and the user should fix it // if not upgrading/downgrading and the dir already exists it seems we have an inconsistent state in the vendor dir and the user should fix it
if (!$prevPackage && is_dir($path) && !$this->filesystem->isDirEmpty($path)) { if (!$prevPackage && is_dir($path) && !$this->filesystem->isDirEmpty($path)) {
throw new IrrecoverableDownloadException('Expected empty path to extract '.$package.' into but directory exists: '.$path); throw new IrrecoverableDownloadException('Expected empty path to extract '.$package.' into but directory exists: '.$path);
} }

@ -425,6 +425,10 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$output = ''; $output = '';
try { try {
if (is_dir($targetDir.'_compare')) {
$this->filesystem->removeDirectory($targetDir.'_compare');
}
$this->download($package, $targetDir.'_compare', null, false); $this->download($package, $targetDir.'_compare', null, false);
$this->httpDownloader->wait(); $this->httpDownloader->wait();
$this->install($package, $targetDir.'_compare', false); $this->install($package, $targetDir.'_compare', false);

Loading…
Cancel
Save