From 2e15f713a0fd36d2569d8f22ab7f6dcff94f3b8a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 13 Dec 2016 01:05:11 +0000 Subject: [PATCH] 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. --- Library/Homebrew/cmd/prune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/prune.rb b/Library/Homebrew/cmd/prune.rb index e2e6d77b8e..9fc6dbcd97 100644 --- a/Library/Homebrew/cmd/prune.rb +++ b/Library/Homebrew/cmd/prune.rb @@ -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