bin/brew: remove unpin from sudo check list

We only need to check sudo for commands which create files.
This commit is contained in:
Xu Cheng 2016-01-18 11:51:02 +08:00
parent e3011dfe91
commit b324d61f35

View File

@ -140,7 +140,7 @@ HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$1.sh"
if [[ "$(id -u)" = "0" && "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]]
then
case "$HOMEBREW_COMMAND" in
instal|install|reinstall|postinstall|ln|link|pin|unpin|update|update-bash|upgrade|create|migrate|tap|switch)
instal|install|reinstall|postinstall|ln|link|pin|update|update-bash|upgrade|create|migrate|tap|switch)
odie <<EOS
Cowardly refusing to 'sudo brew $HOMEBREW_COMMAND'
You can use brew with sudo, but only if the brew executable is owned by root.