bump-revision: fix for new license syntax

This commit is contained in:
Rylan Polster 2020-09-12 12:56:27 -04:00
parent b9982f158d
commit 138c224be9

View File

@ -40,10 +40,12 @@ module Homebrew
end
old = if formula.license
license_string = if formula.license.length > 1
formula.license
license_string = if formula.license.is_a? String
"\"#{formula.license}\""
else
"\"#{formula.license.first}\""
formula.license.to_s.gsub(/:(\w+)=>/, '\1: ') # Change `:any_of=>` to `any_of: `
.tr("{}", "") # Remove braces
.gsub(/=>with: "([a-zA-Z0-9-]+)"/, ' => { with: "\1" }') # Add braces and spacing around exceptions
end
# insert replacement revision after license
<<~EOS