Force brew upgrade
to treat arguments as casks if --cask
is passed.
This commit is contained in:
parent
c9e2a06ff5
commit
e117a68f42
@ -79,8 +79,8 @@ module Homebrew
|
||||
.freeze
|
||||
end
|
||||
|
||||
def to_resolved_formulae_to_casks
|
||||
@to_resolved_formulae_to_casks ||= to_formulae_and_casks(method: :resolve)
|
||||
def to_resolved_formulae_to_casks(only: nil)
|
||||
@to_resolved_formulae_to_casks ||= to_formulae_and_casks(method: :resolve, only: only)
|
||||
.partition { |o| o.is_a?(Formula) }
|
||||
.map(&:freeze).freeze
|
||||
end
|
||||
|
@ -91,7 +91,10 @@ module Homebrew
|
||||
def upgrade
|
||||
args = upgrade_args.parse
|
||||
|
||||
formulae, casks = args.named.to_resolved_formulae_to_casks
|
||||
only = :formula if args.formula? && !args.cask?
|
||||
only = :cask if args.cask? && !args.formula?
|
||||
|
||||
formulae, casks = args.named.to_resolved_formulae_to_casks(only: only)
|
||||
# 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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user