diff --git a/Library/Homebrew/cleaner.rb b/Library/Homebrew/cleaner.rb index 7fd116a901..2d9ce516b0 100644 --- a/Library/Homebrew/cleaner.rb +++ b/Library/Homebrew/cleaner.rb @@ -26,7 +26,13 @@ class Cleaner # We want post-order traversal, so use a stack. paths = [] f.prefix.find do |path| - paths << path if path.directory? + if path.directory? + if f.skip_clean? path + Find.prune + else + paths << path + end + end end paths.each do |d|