Skip to content

Commit

Permalink
Ignore taps of unavailable formulae
Browse files Browse the repository at this point in the history
  • Loading branch information
tt committed Nov 24, 2024
1 parent 876cda0 commit c9d792c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/bundle/commands/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit c9d792c

Please sign in to comment.