Created
May 24, 2018 20:15
-
-
Save tehprofessor/53dde44fd144ac893b1d8c84d66d5618 to your computer and use it in GitHub Desktop.
Fixes Homebrew's annoying upgrade/update behaviour, will break `update --merge` functionality but quite honestly, IDGAF.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew() { | |
local cmd=$1; shift | |
if test "$cmd" = 'upgrade' || test "$cmd" = 'update'; then | |
"__brew_update_or_upgrade" "$@" | |
else | |
command brew "$cmd" "$@" | |
fi | |
} | |
__brew_update_or_upgrade() { | |
local maybe_package=$1; | |
if test -z "$maybe_package"; then | |
command brew update | |
else | |
command brew upgrade "$maybe_package" "$@" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment