repair if syntax and remove useless line

This commit is contained in:
hyuraku 2022-08-27 22:29:07 +09:00
parent b61ae59421
commit 374dd3dea2
3 changed files with 4 additions and 7 deletions

View File

@ -75,9 +75,8 @@ module Cask
options[:quarantine] = true if options[:quarantine].nil?
if dry_run
casks_to_install = casks.reject(&:installed?)
if casks_to_install.present?
plural = "package".pluralize(casks_to_install.count)
if (casks_to_install = casks.reject(&:installed?).presence)
plural = "cask".pluralize(casks_to_install.count)
ohai "Would install #{casks_to_install.count} #{plural}:"
puts casks_to_install.map(&:full_name).join(" ")
end

View File

@ -97,7 +97,6 @@ module Cask
print caveats
fetch
uninstall_existing_cask if reinstall?
backup if force? && @cask.staged_path.exist? && @cask.metadata_versioned_path.exist?

View File

@ -319,9 +319,8 @@ module Homebrew
end.compact
if dry_run
formulae_name_to_install = formulae_to_install.map(&:name)
if formulae_name_to_install.present?
plural = "package".pluralize(formulae_name_to_install.count)
if (formulae_name_to_install = formulae_to_install.map(&:name))
plural = "formula".pluralize(formulae_name_to_install.count)
ohai "Would install #{formulae_name_to_install.count} #{plural}:"
puts formulae_name_to_install.join(" ")