Skip to content

Commit

Permalink
dev-cmd/unbottled: fix total unbottled count
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Sep 17, 2024
1 parent 335d370 commit 133e46e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Library/Homebrew/dev-cmd/unbottled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ def formulae_all_installs_from_args(all)
all_formulae = Formula.all(eval_all: args.eval_all?)
end

# Remove deprecated formulae as we do not care if they are unbottled
formulae = Array(formulae).reject(&:deprecated?) if formulae.present?
all_formulae = Array(all_formulae).reject(&:deprecated?) if all_formulae.present?
# Remove deprecated and disabled formulae as we do not care if they are unbottled
formulae = Array(formulae).reject { |f| f.deprecated? || f.disabled? } if formulae.present?
all_formulae = Array(all_formulae).reject { |f| f.deprecated? || f.disabled? } if all_formulae.present?

[T.let(formulae, T::Array[Formula]), T.let(all_formulae, T::Array[Formula]),
T.let(formula_installs, T.nilable(T::Hash[Symbol, Integer]))]
Expand Down Expand Up @@ -193,12 +193,8 @@ def output_total(formulae)
return unless @bottle_tag

ohai "Unbottled :#{@bottle_tag} formulae"
unbottled_formulae = 0

formulae.each do |f|
next if f.bottle_specification.tag?(@bottle_tag)

unbottled_formulae += 1
unbottled_formulae = formulae.count do |f|
!f.bottle_specification.tag?(@bottle_tag, no_older_versions: true)

Check warning on line 197 in Library/Homebrew/dev-cmd/unbottled.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/unbottled.rb#L196-L197

Added lines #L196 - L197 were not covered by tests
end

puts "#{unbottled_formulae}/#{formulae.length} remaining."
Expand Down

0 comments on commit 133e46e

Please sign in to comment.