cleanup: use early return rather than method-spanning conditional

This commit is contained in:
Jack Nagel 2013-05-15 12:45:36 -05:00
parent 8cd331718e
commit 5515d359d5

View File

@ -14,13 +14,13 @@ module Homebrew extend self
end end
def cleanup_all def cleanup_all
if HOMEBREW_CELLAR.directory? return unless HOMEBREW_CELLAR.directory?
HOMEBREW_CELLAR.children.each do |rack|
begin HOMEBREW_CELLAR.children.each do |rack|
cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory? begin
rescue FormulaUnavailableError cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory?
# Don't complain about directories from DIY installs rescue FormulaUnavailableError
end # Don't complain about directories from DIY installs
end end
end end
clean_cache clean_cache