Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump-revision: fix for new license syntax #8708

Merged
merged 2 commits into from Sep 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions Library/Homebrew/dev-cmd/bump-revision.rb
Expand Up @@ -40,10 +40,15 @@ def bump_revision
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
Expand Down