Browse Source

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.
master
Indrajit Raychaudhuri 6 years ago
parent
commit
34f75bf754
  1. 3
      modules/homebrew/README.md
  2. 17
      modules/homebrew/init.zsh

3
modules/homebrew/README.md

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

17
modules/homebrew/init.zsh

@ -36,10 +36,21 @@ alias brewx='brew remove'
# Homebrew Cask # Homebrew Cask
alias cask='brew cask' alias cask='brew cask'
alias caskc='brew cask cleanup --outdated' alias caskc='hb_deprecated brew cask cleanup'
alias caskC='brew cask cleanup' alias caskC='hb_deprecated brew cask cleanup'
alias caski='brew cask install' alias caski='brew cask install'
alias caskl='brew cask list' alias caskl='brew cask list'
alias casko='brew cask outdated' alias casko='brew cask outdated'
alias casks='brew cask search' alias casks='hb_deprecated brew cask search'
alias caskx='brew cask uninstall' 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}
}

Loading…
Cancel
Save