Skip to content
Snippets Groups Projects
Commit a9a62972 authored by ilovezfs's avatar ilovezfs
Browse files

bump-formula-pr: handle explicit version DSL

--version=1.2.3 option to set `version "1.2.3"`

Note that --version=0 will remove a no-longer-needed explicit version
parent 19df0321
No related branches found
No related tags found
No related merge requests found
......@@ -101,6 +101,7 @@ module Homebrew
new_tag = ARGV.value("tag")
new_revision = ARGV.value("revision")
new_mirror = ARGV.value("mirror")
forced_version = ARGV.value("version")
new_url_hash = if new_url && new_hash
true
elsif new_tag && new_revision
......@@ -155,6 +156,11 @@ module Homebrew
replacement_pairs << [/^( +)(url \"#{new_url}\"\n)/m, "\\1\\2\\1mirror \"#{new_mirror}\"\n"]
end
if forced_version && forced_version != "0"
replacement_pairs << [old_formula_version, forced_version]
elsif forced_version && forced_version == "0"
replacement_pairs << [/^ version \"[a-z\d+\.]+\"\n/m, ""]
end
new_contents = inreplace_pairs(formula.path, replacement_pairs)
new_formula_version = formula_version(formula, requested_spec, new_contents)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment