From 374dd3dea24ff4648fccb61bcbb177f03d543498 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Sat, 27 Aug 2022 22:29:07 +0900 Subject: [PATCH] repair if syntax and remove useless line --- Library/Homebrew/cask/cmd/install.rb | 5 ++--- Library/Homebrew/cask/installer.rb | 1 - Library/Homebrew/install.rb | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/cask/cmd/install.rb b/Library/Homebrew/cask/cmd/install.rb index fb410b83d5..8b088de6b3 100644 --- a/Library/Homebrew/cask/cmd/install.rb +++ b/Library/Homebrew/cask/cmd/install.rb @@ -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 diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 9ef2b3bea2..06b015517a 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -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? diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 9a4cddc3b9..9b21b1029b 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -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(" ")