Merge pull request #8139 from Rylan12/bump-revision-fix

bump-revision: fixes for new style and license dsl
This commit is contained in:
Rylan Polster 2020-07-30 12:21:02 -04:00 committed by GitHub
commit f4f4d911c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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
@ -59,7 +64,7 @@ module Homebrew
else
# insert replacement revision after :revision
<<~EOS
:revision => "#{formula_spec.specs[:revision]}"
revision: "#{formula_spec.specs[:revision]}"
EOS
end
replacement = old + " revision 1\n"