Merge pull request #8708 from Rylan12/bump-revision-fix-license

bump-revision: fix for new license syntax
This commit is contained in:
Mike McQuaid 2020-09-14 09:47:42 +01:00 committed by GitHub
commit c7e4a3d8b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,10 +40,15 @@ module Homebrew
end
old = if formula.license
license_string = if formula.license.length > 1
formula.license
license_string = case formula.license
when String
"\"#{formula.license}\""
when Symbol
":#{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