From 876021a926f9ef1ba6c555353f7a43678e97fb8b Mon Sep 17 00:00:00 2001 From: Caleb Xu Date: Fri, 21 Sep 2018 12:23:09 -0400 Subject: [PATCH] prune: preserve some directories Some directories, while empty, are created in brew upgrade and should be kept. --- Library/Homebrew/cmd/prune.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb index b7aaf7612a..55edc5b610 100644 --- a/Library/Homebrew/cmd/prune.rb +++ b/Library/Homebrew/cmd/prune.rb @@ -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