prune: preserve some directories

Some directories, while empty, are created in brew upgrade and
should be kept.
This commit is contained in:
Caleb Xu 2018-09-21 12:23:09 -04:00
parent 8125aba04e
commit 876021a926

View File

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