Browse Source

Clean up properly after creating the vendor dir

Jordi Boggiano 11 years ago
parent
commit
1110074d5f
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/Composer/Downloader/ArchiveDownloader.php

+ 6 - 0
src/Composer/Downloader/ArchiveDownloader.php

@@ -64,6 +64,12 @@ abstract class ArchiveDownloader extends FileDownloader
                 }
 
                 $this->filesystem->removeDirectory($temporaryDir);
+                if ($this->filesystem->isDirEmpty($this->config->get('vendor-dir').'/composer/')) {
+                    $this->filesystem->removeDirectory($this->config->get('vendor-dir').'/composer/');
+                }
+                if ($this->filesystem->isDirEmpty($this->config->get('vendor-dir'))) {
+                    $this->filesystem->removeDirectory($this->config->get('vendor-dir'));
+                }
             } catch (\Exception $e) {
                 // clean up
                 $this->filesystem->removeDirectory($path);