From 541459791351a69b7b70047ee5e0c2c05797de92 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Thu, 13 Aug 2015 20:41:16 +0800 Subject: [PATCH] cleanup: avoid duplicated logic Closes Homebrew/homebrew#42900. Signed-off-by: Xu Cheng --- Library/Homebrew/cmd/cleanup.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index 9a211dcbc1..8d53546737 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -31,12 +31,8 @@ module Homebrew end def cleanup_cellar - Formula.racks.each do |rack| - begin - cleanup_formula Formulary.from_rack(rack) - rescue FormulaUnavailableError, TapFormulaAmbiguityError - # Don't complain about directories from DIY installs - end + Formula.installed.each do |formula| + cleanup_formula formula end end