Skip to content
Snippets Groups Projects
Commit 7ed19d4c authored by Mike McQuaid's avatar Mike McQuaid
Browse files

Check if Cellar and Cache exist before cleaning.

parent 7d61bfe8
No related branches found
No related tags found
No related merge requests found
......@@ -7,12 +7,14 @@ module Homebrew extend self
def cleanup
if ARGV.named.empty?
HOMEBREW_CELLAR.children.each do |rack|
begin
cleanup_formula rack.basename.to_s if rack.directory?
rescue FormulaUnavailableError => e
# Don't complain about Cellar folders that are from DIY installs
# instead of core formulae.
if HOMEBREW_CELLAR.directory?
HOMEBREW_CELLAR.children.each do |rack|
begin
cleanup_formula rack.basename.to_s if rack.directory?
rescue FormulaUnavailableError => e
# Don't complain about Cellar folders that are from DIY installs
# instead of core formulae.
end
end
end
clean_cache
......@@ -54,6 +56,7 @@ module Homebrew extend self
end
def clean_cache
return unless HOMEBREW_CACHE.directory?
HOMEBREW_CACHE.children.each do |pn|
next unless pn.file?
version = pn.version
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment