Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/bump: Ignore Repology if the livecheck uses GithubLatest #12900

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,14 @@ def livecheck_result(formula_or_cask)
version_info = Livecheck.latest_version(
formula_or_cask,
referenced_formula_or_cask: referenced_formula_or_cask,
json: true, full_name: false, verbose: false, debug: false
json: true, full_name: false, verbose: true, debug: false
)
latest = version_info[:latest] if version_info.present?
return "unable to get versions" if version_info.blank?

return "unable to get versions" if latest.blank?
latest = version_info[:latest]
strategy = version_info[:meta][:strategy]

Version.new(latest)
[Version.new(latest), strategy]
rescue => e
"error: #{e}"
end
Expand All @@ -233,7 +234,7 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a
version_name = "cask version "
end

livecheck_latest = livecheck_result(formula_or_cask)
livecheck_latest, livecheck_strategy = livecheck_result(formula_or_cask)

repology_latest = if repositories.present?
Repology.latest_version(repositories)
Expand All @@ -243,7 +244,7 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a

new_version = if livecheck_latest.is_a?(Version) && livecheck_latest > current_version
livecheck_latest
elsif repology_latest.is_a?(Version) && repology_latest > current_version
elsif repology_latest.is_a?(Version) && repology_latest > current_version && livecheck_strategy != "GithubLatest"
repology_latest
end.presence

Expand Down