cleanup: factor out unqualified cleanup code

This commit is contained in:
Jack Nagel 2013-05-15 12:45:35 -05:00
parent c48ac0b982
commit 8cd331718e

View File

@ -7,6 +7,13 @@ module Homebrew extend self
def cleanup
if ARGV.named.empty?
cleanup_all
else
ARGV.formulae.each { |f| cleanup_formula(f) }
end
end
def cleanup_all
if HOMEBREW_CELLAR.directory?
HOMEBREW_CELLAR.children.each do |rack|
begin
@ -22,11 +29,6 @@ module Homebrew extend self
Homebrew.prune
rm_DS_Store
end
else
ARGV.formulae.each do |f|
cleanup_formula f
end
end
end
def cleanup_formula f