cmd/upgrade: fix cask/formula args (again).

Fixes https://github.com/Homebrew/brew/issues/8228#issuecomment-670161766
This commit is contained in:
Mike McQuaid 2020-08-07 10:25:29 +01:00
parent e4c9f769a0
commit 863a0964e2
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -77,14 +77,16 @@ module Homebrew
# If one or more formulae are specified, but no casks were
# specified, we want to make note of that so we don't
# try to upgrade all outdated casks.
upgrade_formulae = formulae.present? && casks.blank? && !args.cask?
upgrade_casks = casks.present? && formulae.blank? && !args.formula?
upgrade_formulae = formulae.present? && casks.blank?
upgrade_casks = casks.present? && formulae.blank?
upgrade_outdated_formulae(formulae, args: args) unless upgrade_casks
upgrade_outdated_casks(casks, args: args) unless upgrade_formulae
end
def upgrade_outdated_formulae(formulae, args:)
return if args.cask?
FormulaInstaller.prevent_build_flags(args)
Install.perform_preinstall_checks
@ -143,6 +145,8 @@ module Homebrew
end
def upgrade_outdated_casks(casks, args:)
return if args.formula?
Cask::Cmd::Upgrade.upgrade_casks(
*casks,
force: args.force?,