Skip to content

Commit

Permalink
Merge pull request #16132 from apainintheneck/replace-url-before-down…
Browse files Browse the repository at this point in the history
…loading-to-check-checksum

dev-cmd/bump-cask-pr: replace url before downloading files
  • Loading branch information
MikeMcQuaid authored Oct 24, 2023
2 parents 4e2c9ad + c033a46 commit 64d309c
Showing 1 changed file with 16 additions and 16 deletions.
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 @@ def bump_cask_pr
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 @@ def bump_cask_pr
]
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}"
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

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

# Remove nested arrays where elements are identical
Expand Down

0 comments on commit 64d309c

Please sign in to comment.