mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #8082 from dawidd6/bump
bump-formula-pr: fix when no 'version' stanza in formula found
This commit is contained in:
commit
886d2edec2
@ -276,11 +276,16 @@ module Homebrew
|
|||||||
/^( +)(mirror "#{Regexp.escape(new_mirrors.last)}"\n)/m,
|
/^( +)(mirror "#{Regexp.escape(new_mirrors.last)}"\n)/m,
|
||||||
"\\1\\2\\1version \"#{new_version}\"\n",
|
"\\1\\2\\1version \"#{new_version}\"\n",
|
||||||
]
|
]
|
||||||
else
|
elsif new_url
|
||||||
[
|
[
|
||||||
/^( +)(url "#{Regexp.escape(new_url)}"\n)/m,
|
/^( +)(url "#{Regexp.escape(new_url)}"\n)/m,
|
||||||
"\\1\\2\\1version \"#{new_version}\"\n",
|
"\\1\\2\\1version \"#{new_version}\"\n",
|
||||||
]
|
]
|
||||||
|
elsif new_revision
|
||||||
|
[
|
||||||
|
/^( {2})( +)(:revision => "#{new_revision}"\n)/m,
|
||||||
|
"\\1\\2\\3\\1version \"#{new_version}\"\n",
|
||||||
|
]
|
||||||
end
|
end
|
||||||
elsif forced_version && new_version == "0"
|
elsif forced_version && new_version == "0"
|
||||||
replacement_pairs << [
|
replacement_pairs << [
|
||||||
@ -288,7 +293,7 @@ module Homebrew
|
|||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
new_contents = inreplace_pairs(formula.path, replacement_pairs.uniq)
|
new_contents = inreplace_pairs(formula.path, replacement_pairs.uniq.compact)
|
||||||
|
|
||||||
new_formula_version = formula_version(formula, requested_spec, new_contents)
|
new_formula_version = formula_version(formula, requested_spec, new_contents)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user