From 77975168e0f2d5e6627d049d6055bc159e3fd89d Mon Sep 17 00:00:00 2001 From: Martin Afanasjew Date: Thu, 21 Jan 2016 16:39:57 +0100 Subject: [PATCH] bin/brew: add support for developer bash commands This also means `bin/brew` is again consistent with `brew command` and `brew commands`. --- bin/brew | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/brew b/bin/brew index 75ece8cf4e..6512aec1c0 100755 --- a/bin/brew +++ b/bin/brew @@ -135,7 +135,11 @@ then fi 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" ]] then @@ -151,7 +155,7 @@ EOS esac fi -if [[ -f "$HOMEBREW_BASH_COMMAND" ]] +if [[ -n "$HOMEBREW_BASH_COMMAND" ]] then # Bash commands don't need the first argument, which is just the command name. shift