Skip to content

Commit

Permalink
Merge pull request #16004 from EricFromCanada/bump-reduce-output
Browse files Browse the repository at this point in the history
dev-cmd/bump: reduce unnecessary output
  • Loading branch information
MikeMcQuaid authored Sep 14, 2023
2 parents 1a481be + 7c70721 commit b2cf50b
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ def handle_formula_and_casks(formulae_and_casks, args)
use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask)
name = Livecheck.package_or_resource_name(formula_or_cask, full_name: use_full_name)
repository = if formula_or_cask.is_a?(Formula)
if formula_or_cask.head_only?
puts "Formula is HEAD-only."
next
end
next if skip_ineligible_formulae(formula_or_cask)

Repology::HOMEBREW_CORE
else
Expand Down Expand Up @@ -201,6 +198,8 @@ def handle_api_response(args)
end

puts if i.positive?
next if formula_or_cask.is_a?(Formula) && skip_ineligible_formulae(formula_or_cask)

retrieve_and_display_info_and_open_pr(
formula_or_cask,
name,
Expand All @@ -212,6 +211,17 @@ def handle_api_response(args)
end
end

sig {
params(formula: Formula).returns(T::Boolean)
}
def skip_ineligible_formulae(formula)
return false if !formula.disabled? && !formula.head_only?

ohai formula.name
puts "Formula is #{formula.disabled? ? "disabled" : "HEAD-only"}.\n"
true
end

sig {
params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T.any(Version, String))
}
Expand Down Expand Up @@ -436,6 +446,8 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
Current #{version_label} #{current_versions}
Latest livecheck version: #{new_versions}
Latest Repology version: #{repology_latest}
EOS
puts <<~EOS unless args.no_pull_requests?
Open pull requests: #{open_pull_requests || "none"}
Closed pull requests: #{closed_pull_requests || "none"}
EOS
Expand Down

0 comments on commit b2cf50b

Please sign in to comment.