homebrew: Replace deprecated casks with their brew counterpart

Homebrew has deprecated `brew cask cleanup` and `brew cask search` in favor
of `brew cleanup` and `brew search` respectively. They will stop working on
2018-09-30. Further, `--outdated` has been removed.

We should eventually remove the related aliases, but for a while we keep
supporting them gracefully with deprecation warning.

The documentation has been removed from README.md, however.
This commit is contained in:
Indrajit Raychaudhuri 2018-09-15 01:45:57 -05:00
parent 2bbf5d0687
commit ad861d3b45
2 changed files with 14 additions and 6 deletions

View file

@ -29,12 +29,9 @@ Aliases
### Homebrew Cask
- `cask` is aliased to `brew cask`.
- `caskc` cleans up old cached downloads.
- `caskC` cleans up all cached downloads.
- `caski` installs a cask.
- `caskl` lists installed casks.
- `casko` lists casks which have an update available.
- `casks` searches for a cask.
- `caskx` uninstalls a cask.
Authors

View file

@ -36,10 +36,21 @@ alias brewx='brew remove'
# Homebrew Cask
alias cask='brew cask'
alias caskc='brew cask cleanup --outdated'
alias caskC='brew cask cleanup'
alias caskc='hb_deprecated brew cask cleanup'
alias caskC='hb_deprecated brew cask cleanup'
alias caski='brew cask install'
alias caskl='brew cask list'
alias casko='brew cask outdated'
alias casks='brew cask search'
alias casks='hb_deprecated brew cask search'
alias caskx='brew cask uninstall'
function hb_deprecated {
local cmd="${argv[3]}"
local cmd_args=( ${(@)argv:4} )
printf "'brew cask %s' has been deprecated, " "${cmd}"
printf "using 'brew %s' instead\n" "${cmd}"
cmd_args=( ${(@)argv:4} )
command brew "${cmd}" ${(@)cmd_args}
}