cleanup: use early return rather than method-spanning conditional
This commit is contained in:
parent
8cd331718e
commit
5515d359d5
@ -14,7 +14,8 @@ 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|
|
HOMEBREW_CELLAR.children.each do |rack|
|
||||||
begin
|
begin
|
||||||
cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory?
|
cleanup_formula Formula.factory(rack.basename.to_s) if rack.directory?
|
||||||
@ -22,7 +23,6 @@ module Homebrew extend self
|
|||||||
# Don't complain about directories from DIY installs
|
# Don't complain about directories from DIY installs
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
clean_cache
|
clean_cache
|
||||||
# seems like a good time to do some additional cleanup
|
# seems like a good time to do some additional cleanup
|
||||||
unless ARGV.dry_run?
|
unless ARGV.dry_run?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user