bump-revision: insert after homepage if stable block is present

This commit is contained in:
EricFromCanada 2020-04-25 00:32:13 -04:00 committed by Alexander Bayandin
parent 7ba0f34f72
commit 5a4a57310f

View File

@ -42,7 +42,12 @@ module Homebrew
[checksum.hash_type, checksum.hexdigest]
end
old = if hash_type
old = if formula.path.read.include?("stable do\n")
# insert replacement revision after homepage
<<~EOS
homepage "#{formula.homepage}"
EOS
elsif hash_type
# insert replacement revision after hash
<<~EOS
#{hash_type} "#{old_hash}"