From a080ae3a51a16e1cbfe0c881797dba869cef95af Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 31 Aug 2013 15:42:26 +0200 Subject: [PATCH] Make sure directories we are downloading to are empty We already clear them on error anyway and usually they should be empty, but just to be safe. --- src/Composer/Downloader/FileDownloader.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 8ed0712bf..e67693563 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -79,6 +79,7 @@ class FileDownloader implements DownloaderInterface throw new \InvalidArgumentException('The given package is missing url information'); } + $this->filesystem->removeDirectory($path); $this->filesystem->ensureDirectoryExists($path); $fileName = $this->getFileName($package, $path);