diff --git a/Library/Homebrew/update_migrator.rb b/Library/Homebrew/update_migrator.rb index 5351385973..a2e5557996 100644 --- a/Library/Homebrew/update_migrator.rb +++ b/Library/Homebrew/update_migrator.rb @@ -40,6 +40,9 @@ module UpdateMigrator return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA") + return unless HOMEBREW_CACHE.directory? + return if HOMEBREW_CACHE.children.empty? + ohai "Migrating cache entries..." Formula.each do |formula| @@ -78,6 +81,9 @@ module UpdateMigrator return if ENV.key?("HOMEBREW_DISABLE_LOAD_FORMULA") + return unless HOMEBREW_CACHE.directory? + return if HOMEBREW_CACHE.children.empty? + ohai "Migrating cache entries..." cache_entries = lambda do |path|