Add additional quiet check in update-report

This commit is contained in:
Darren Kavanagh 2021-03-16 14:50:51 -07:00 committed by Carlo Cabrera
parent a96e364b41
commit 92a42381df
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -91,10 +91,7 @@ module Homebrew
"git", "-C", HOMEBREW_REPOSITORY, "tag", "--list", "--sort=-version:refname", "*.*" "git", "-C", HOMEBREW_REPOSITORY, "tag", "--list", "--sort=-version:refname", "*.*"
).lines.first.chomp ).lines.first.chomp
if new_tag != old_tag new_repository_version = new_tag unless new_tag == old_tag
Settings.write "latesttag", new_tag
new_repository_version = new_tag
end
end end
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]
@ -189,11 +186,13 @@ module Homebrew
puts_stdout_or_stderr puts_stdout_or_stderr
ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}" ohai_stdout_or_stderr "Homebrew was updated to version #{new_repository_version}"
if new_repository_version.split(".").last == "0" if new_repository_version.split(".").last == "0"
Settings.write "latesttag", new_repository_version
puts_stdout_or_stderr <<~EOS puts_stdout_or_stderr <<~EOS
More detailed release notes are available on the Homebrew Blog: More detailed release notes are available on the Homebrew Blog:
#{Formatter.url("https://brew.sh/blog/#{new_repository_version}")} #{Formatter.url("https://brew.sh/blog/#{new_repository_version}")}
EOS EOS
else elsif !args.quiet?
Settings.write "latesttag", new_repository_version
puts_stdout_or_stderr <<~EOS puts_stdout_or_stderr <<~EOS
The changelog can be found at: The changelog can be found at:
#{Formatter.url("https://github.com/Homebrew/brew/releases/tag/#{new_repository_version}")} #{Formatter.url("https://github.com/Homebrew/brew/releases/tag/#{new_repository_version}")}