From 80f1e4372a10427aaf06d5cda87a9bf74db200ab Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 22 Sep 2015 23:54:43 +0100 Subject: [PATCH] Remove empty bin dir after all binaries have been removed from it, fixes #3451 --- src/Composer/Installer/LibraryInstaller.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index aa2d46062..b785c4da2 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/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()