Browse Source

Remove empty bin dir after all binaries have been removed from it, fixes #3451

Jordi Boggiano 9 năm trước cách đây
mục cha
commit
80f1e4372a
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      src/Composer/Installer/LibraryInstaller.php

+ 5 - 0
src/Composer/Installer/LibraryInstaller.php

@@ -266,6 +266,11 @@ class LibraryInstaller implements InstallerInterface
                 $this->filesystem->unlink($link.'.bat');
             }
         }
+
+        // attempt removing the bin dir in case it is left empty
+        if ($this->filesystem->isDirEmpty($this->binDir)) {
+            @rmdir($this->binDir);
+        }
     }
 
     protected function initializeVendorDir()