Переглянути джерело

Avoid wiping the whole target package if download of the new one fails, refs #7929

Jordi Boggiano 5 роки тому
батько
коміт
6a7220fed8
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/Composer/Downloader/FileDownloader.php

+ 3 - 1
src/Composer/Downloader/FileDownloader.php

@@ -175,7 +175,9 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
 
         $reject = function ($e) use ($io, &$urls, $download, $fileName, $path, $package, &$retries, $filesystem, $self) {
             // clean up
-            $filesystem->removeDirectory($path);
+            if (file_exists($fileName)) {
+                $filesystem->unlink($fileName);
+            }
             $self->clearLastCacheWrite($package);
 
             if ($e instanceof TransportException) {