bin/brew: add support for developer bash commands

This also means `bin/brew` is again consistent with `brew command` and
`brew commands`.
This commit is contained in:
Martin Afanasjew 2016-01-21 16:39:57 +01:00
parent da47ca9213
commit 77975168e0

View File

@ -135,7 +135,11 @@ then
fi fi
HOMEBREW_COMMAND="$1" HOMEBREW_COMMAND="$1"
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$1.sh" if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]] ; then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"
elif [[ -n "$HOMEBREW_DEVELOPER" && -f "$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh" ]] ; then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/dev-cmd/$HOMEBREW_COMMAND.sh"
fi
if [[ "$(id -u)" = "0" && "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]] if [[ "$(id -u)" = "0" && "$(stat -f%u "$HOMEBREW_BREW_FILE")" != "0" ]]
then then
@ -151,7 +155,7 @@ EOS
esac esac
fi fi
if [[ -f "$HOMEBREW_BASH_COMMAND" ]] if [[ -n "$HOMEBREW_BASH_COMMAND" ]]
then then
# Bash commands don't need the first argument, which is just the command name. # Bash commands don't need the first argument, which is just the command name.
shift shift