Merge pull request #8390 from MLH-Fellowship/deprecate-cask

cask: Add TODOs to deprecate integrated cask commands
This commit is contained in:
Mike McQuaid 2020-08-19 11:27:28 +01:00 committed by GitHub
commit b26e04ad1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -47,6 +47,16 @@ module Cask
"dr" => "doctor", "dr" => "doctor",
}.freeze }.freeze
DEPRECATED_COMMANDS = {
Cmd::Cache => "brew --cache --cask",
Cmd::Doctor => "brew doctor --verbose",
Cmd::Home => "brew home",
Cmd::List => "brew list --cask",
Cmd::Outdated => "brew outdated --cask",
Cmd::Reinstall => "brew reinstall",
Cmd::Upgrade => "brew upgrade --cask",
}.freeze
def self.description def self.description
max_command_len = Cmd.commands.map(&:length).max max_command_len = Cmd.commands.map(&:length).max
@ -212,6 +222,11 @@ module Cask
detect_external_command(*argv) || detect_external_command(*argv) ||
[args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv] [args.remaining.empty? ? NullCommand : UnknownSubcommand.new(args.remaining.first), argv]
# TODO: enable for next major/minor release
# if (replacement = DEPRECATED_COMMANDS[command])
# odeprecated "brew cask #{command.command_name}", replacement
# end
if args.help? if args.help?
puts command.help puts command.help
else else

View File

@ -18,9 +18,6 @@ module Cask
end end
def run def run
# TODO: enable for next major/minor release
# odeprecated "brew cask --cache", "brew --cache --cask"
casks.each do |cask| casks.each do |cask|
puts self.class.cached_location(cask) puts self.class.cached_location(cask)
end end

View File

@ -8,9 +8,6 @@ module Cask
end end
def run def run
# TODO: enable for next major/minor release
# odeprecated "brew cask home", "brew home"
if casks.none? if casks.none?
odebug "Opening project homepage" odebug "Opening project homepage"
self.class.open_url "https://brew.sh/" self.class.open_url "https://brew.sh/"