Skip to content

Commit

Permalink
main: patch brew to restore force functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
dawidd6 committed Oct 15, 2024
1 parent fb2da94 commit fce36cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
12 changes: 12 additions & 0 deletions bump-formula-pr.rb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 167ea9134a..e07aecfe83 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -472,6 +472,7 @@ module Homebrew
def check_pull_requests(formula, tap_remote_repo, state: nil, version: nil)
tap = formula.tap
return if tap.nil?
+ return if args.force?

# if we haven't already found open requests, try for an exact match across all pull requests
GitHub.check_for_duplicate_pull_requests(
9 changes: 5 additions & 4 deletions main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ def read_brew(*args)
end
message += '[`action-homebrew-bump-formula`](https://github.com/dawidd6/action-homebrew-bump-formula)'

unless force.false?
brew_repo = read_brew '--repository'
git '-C', brew_repo, 'apply', "#{__dir__}/brew-bump-formula-pr.rb.patch"
end

# Do the livecheck stuff or not
if livecheck.false?
# Change formula name to full name
Expand All @@ -115,8 +120,6 @@ def read_brew(*args)
*("--version=#{version}" unless is_git),
*("--tag=#{tag}" if is_git),
*("--revision=#{revision}" if is_git),
*('--force' unless force.false?),
*('--quiet' unless force.false?),
formula
else
# Support multiple formulae in input and change to full names if tap
Expand Down Expand Up @@ -157,8 +160,6 @@ def read_brew(*args)
"--version=#{version}",
*("--fork-org=#{org}" unless org.blank?),
*("--no-fork" unless no_fork.false?),
*('--force' unless force.false?),
*('--quiet' unless force.false?),
formula
rescue ErrorDuringExecution => e
# Continue execution on error, but save the exeception
Expand Down

0 comments on commit fce36cd

Please sign in to comment.