Output message if no Casks are outdated

This commit is contained in:
L. E. Segovia 2017-11-22 00:45:29 +00:00
parent 8ee6ac2613
commit c9b5de4cab

View File

@ -14,7 +14,10 @@ module Hbc
def run
outdated_casks = casks(alternative: -> { Hbc.installed }).select { |cask| cask.outdated?(greedy?) }
return if outdated_casks.empty?
if outdated_casks.empty?
oh1 "No Casks to upgrade"
return
end
oh1 "Upgrading #{Formatter.pluralize(outdated_casks.length, "outdated package")}, with result:"
puts outdated_casks.map { |f| "#{f.full_name} #{f.version}" } * ", "