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 8663a3f commit 3ef2ab7
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

Check warning on line 167 in lib/bundle/commands/cleanup.rb

View check run for this annotation

Codecov / codecov/patch

lib/bundle/commands/cleanup.rb#L167

Added line #L167 was not covered by tests
end

def vscode_extensions_to_uninstall(global: false, file: nil)
Expand Down

0 comments on commit 3ef2ab7

Please sign in to comment.