diff options
| author | Mike McQuaid | 2015-08-13 10:31:37 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2015-08-13 10:31:37 +0100 |
| commit | 04b350dce5d0ac7e87ab4b5882dd1a5f19f39a9d (patch) | |
| tree | 9d8c45d40283e62ac9229695a5246db0c2fe569c /Library | |
| parent | e49a0434014464488de356550ffaa6028666faf5 (diff) | |
| download | brew-04b350dce5d0ac7e87ab4b5882dd1a5f19f39a9d.tar.bz2 | |
cleanup: do cleanup even without a Cellar.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/cleanup.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/cleanup.rb b/Library/Homebrew/cmd/cleanup.rb index d90530058..eda8295d6 100644 --- a/Library/Homebrew/cmd/cleanup.rb +++ b/Library/Homebrew/cmd/cleanup.rb @@ -4,10 +4,6 @@ require "bottles" module Homebrew def cleanup - # individual cleanup_ methods should also check for the existence of the - # appropriate directories before assuming they exist - return unless HOMEBREW_CELLAR.directory? - if ARGV.named.empty? cleanup_cellar cleanup_cache @@ -35,6 +31,7 @@ module Homebrew end def cleanup_cellar + return unless HOMEBREW_CELLAR.directory? HOMEBREW_CELLAR.subdirs.each do |rack| begin cleanup_formula Formulary.from_rack(rack) @@ -92,6 +89,8 @@ module Homebrew next unless version next unless (name = file.basename.to_s[/(.*)-(?:#{Regexp.escape(version)})/, 1]) + next unless HOMEBREW_CELLAR.directory? + begin f = Formulary.from_rack(HOMEBREW_CELLAR/name) rescue FormulaUnavailableError, TapFormulaAmbiguityError |
