Merge pull request #10654 from dtrodrigues/update-plural

update-report: use appropriate pronoun in update message
This commit is contained in:
Dustin Rodrigues 2021-02-22 13:06:16 -05:00 committed by GitHub
commit 52e1fadb70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,11 @@ module Homebrew
unless args.preinstall?
outdated_formulae = Formula.installed.count(&:outdated?)
outdated_casks = Cask::Caskroom.casks.count(&:outdated?)
update_pronoun = if (outdated_formulae + outdated_casks) == 1
"it"
else
"them"
end
msg = ""
if outdated_formulae.positive?
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{"formula".pluralize(outdated_formulae)}"
@ -152,7 +157,7 @@ module Homebrew
puts_stdout_or_stderr
puts_stdout_or_stderr <<~EOS
You have #{msg} installed.
You can update them with #{Tty.bold}brew upgrade#{Tty.reset}.
You can update #{update_pronoun} with #{Tty.bold}brew upgrade#{Tty.reset}.
EOS
end
end