bump-revision: handle array of licenses

Allowing multiple licenses meant that `formula.license` returned an
array. This converts that array to the appropriate format for
`bump-revision`
This commit is contained in:
Rylan Polster 2020-07-30 09:30:44 -04:00
parent 8d97029b03
commit 1ac470fe7a

View File

@ -42,9 +42,14 @@ module Homebrew
end
old = if formula.license
license_string = if formula.license.length > 1
formula.license
else
"\"#{formula.license.first}\""
end
# insert replacement revision after license
<<~EOS
license "#{formula.license}"
license #{license_string}
EOS
elsif formula.path.read.include?("stable do\n")
# insert replacement revision after homepage