prune: don't remove top-level directories.

Even if they're empty we want to keep these top-level directories around
as the installer has nicely created them with the correct permissions
and this avoids potentially having to use `sudo` to recreate them.
This commit is contained in:
Mike McQuaid 2016-12-13 01:05:11 +00:00
parent 666463ca2b
commit 2e15f713a0

View File

@ -35,7 +35,7 @@ module Homebrew
path.unlink
end
end
elsif path.directory?
elsif path.directory? && !Keg::PRUNEABLE_DIRECTORIES.include?(path)
dirs << path
end
end