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-cask-pr: replace url before downloading files #16132

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions Library/Homebrew/dev-cmd/bump-cask-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,22 +116,6 @@
branch_name = "bump-#{cask.token}"
commit_message = nil

if new_version.present?
# For simplicity, our naming defers to the arm version if we multiple architectures are specified
branch_version = new_version.arm || new_version.general
if branch_version.is_a?(Cask::DSL::Version)
commit_version = if branch_version.before_comma == cask.version.before_comma
branch_version
else
branch_version.before_comma
end
branch_name = "bump-#{cask.token}-#{branch_version.tr(",:", "-")}"
commit_message ||= "#{cask.token} #{commit_version}"
end
replacement_pairs = replace_version_and_checksum(cask, new_hash, new_version, replacement_pairs)
end
# Now that we have all replacement pairs, we will replace them further down

old_contents = File.read(cask.sourcefile_path)

if new_base_url
Expand All @@ -148,6 +132,22 @@
]
end

if new_version.present?
# For simplicity, our naming defers to the arm version if we multiple architectures are specified
branch_version = new_version.arm || new_version.general
if branch_version.is_a?(Cask::DSL::Version)
commit_version = if branch_version.before_comma == cask.version.before_comma
branch_version
else
branch_version.before_comma
end
branch_name = "bump-#{cask.token}-#{branch_version.tr(",:", "-")}"
commit_message ||= "#{cask.token} #{commit_version}"

Check warning on line 145 in Library/Homebrew/dev-cmd/bump-cask-pr.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump-cask-pr.rb#L144-L145

Added lines #L144 - L145 were not covered by tests
end
replacement_pairs = replace_version_and_checksum(cask, new_hash, new_version, replacement_pairs)

Check warning on line 147 in Library/Homebrew/dev-cmd/bump-cask-pr.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump-cask-pr.rb#L147

Added line #L147 was not covered by tests
end
# Now that we have all replacement pairs, we will replace them further down

commit_message ||= "#{cask.token}: update checksum" if new_hash

# Remove nested arrays where elements are identical
Expand Down