cleanup: factor out unqualified cleanup code
This commit is contained in:
parent
c48ac0b982
commit
8cd331718e
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user