cleanup: optimize perfermance

Only remove .DS_Store files from whitelisted directories.

Closes Homebrew/homebrew#37409.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-03-06 10:39:46 +08:00
parent 11defcf847
commit 89325bbb19

View File

@ -111,7 +111,10 @@ module Homebrew
end
def rm_DS_Store
quiet_system "find", HOMEBREW_PREFIX.to_s, "-name", ".DS_Store", "-delete"
paths = %w[Cellar Frameworks Library bin etc include lib opt sbin share var].
map { |p| HOMEBREW_PREFIX/p }.select(&:exist?)
args = paths.map(&:to_s) + %w[-name .DS_Store -delete]
quiet_system "find", *args
end
end