浏览代码

Clean up properly after creating the vendor dir

Jordi Boggiano 11 年之前
父节点
当前提交
1110074d5f
共有 1 个文件被更改,包括 6 次插入0 次删除
  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);