Skip to content
Snippets Groups Projects
Commit e117a68f authored by Markus Reiter's avatar Markus Reiter
Browse files

Force `brew upgrade` to treat arguments as casks if `--cask` is passed.

parent c9e2a06f
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment