From c9d792ccab7fa74dc6f610a07489a27883e8791e Mon Sep 17 00:00:00 2001 From: Troels Thomsen Date: Sun, 24 Nov 2024 08:42:52 +0100 Subject: [PATCH] Ignore taps of unavailable formulae --- lib/bundle/commands/cleanup.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bundle/commands/cleanup.rb b/lib/bundle/commands/cleanup.rb index 36bc6b026..132d3cb68 100644 --- a/lib/bundle/commands/cleanup.rb +++ b/lib/bundle/commands/cleanup.rb @@ -153,7 +153,7 @@ def recursive_dependencies(current_formulae, formulae_names, top_level: true) def taps_to_untap(global: false, file: nil) @dsl ||= Brewfile.read(global:, file:) - kept_formulae = self.kept_formulae(global:, file:).map(&method(:lookup_formula)) + kept_formulae = self.kept_formulae(global:, file:).filter_map(&method(:lookup_formula)) kept_taps = @dsl.entries.select { |e| e.type == :tap }.map(&:name) kept_taps += kept_formulae.filter_map(&:tap).map(&:name) current_taps = Bundle::TapDumper.tap_names @@ -162,6 +162,9 @@ def taps_to_untap(global: false, file: nil) def lookup_formula(formula) Formulary.factory(formula) + rescue TapFormulaUnavailableError + # ignore these as an unavailable formula implies there is no tap to worry about + nil end def vscode_extensions_to_uninstall(global: false, file: nil)