Handle formatted versions ending with build version.
This commit is contained in:
parent
96bbf1ac15
commit
d6f30a4bc1
@ -275,7 +275,7 @@ module Homebrew
|
||||
end
|
||||
|
||||
if short_version&.match?(/\A\d+(\.\d+)*\Z/) && version&.match?(/\A\d+\Z/)
|
||||
return short_version if short_version.start_with?("#{version}.")
|
||||
return short_version if short_version.start_with?("#{version}.") || short_version.end_with?(".#{version}")
|
||||
|
||||
return "#{short_version},#{version}"
|
||||
end
|
||||
|
@ -17,6 +17,8 @@ describe "Homebrew.bump_unversioned_casks_args" do
|
||||
["1.2.3", "8312"] => "1.2.3,8312",
|
||||
["2021", "2006"] => "2021,2006",
|
||||
["1.0", "1"] => "1.0",
|
||||
["1.0", "0"] => "1.0",
|
||||
["1.2.3.4000", "4000"] => "1.2.3.4000",
|
||||
}
|
||||
|
||||
expected_mappings.each do |(short_version, version), expected_version|
|
||||
|
Loading…
x
Reference in New Issue
Block a user