aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/brew.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/brew.sh')
-rw-r--r--Library/Homebrew/brew.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index c8f66bd45..795ddcc4d 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -79,18 +79,6 @@ then
export HOMEBREW_GEM_PATH="$GEM_PATH"
fi
-# Users may have these set, pointing the system Ruby
-# at non-system gem paths
-unset GEM_HOME
-unset GEM_PATH
-
-# Users may have this set, injecting arbitrary environment changes into
-# bash processes inside builds
-unset BASH_ENV
-
-# Users may have this set, breaking grep's output.
-unset GREP_OPTIONS
-
HOMEBREW_SYSTEM="$(uname -s)"
case "$HOMEBREW_SYSTEM" in
Darwin) HOMEBREW_MACOS="1" ;;
@@ -246,6 +234,18 @@ case "$HOMEBREW_COMMAND" in
--config) HOMEBREW_COMMAND="config" ;;
esac
+# Set HOMEBREW_DEV_CMD_RUN for users who have run a development command.
+# This makes them behave like HOMEBREW_DEVELOPERs for brew update.
+if [[ -z "$HOMEBREW_DEVELOPER" ]]
+then
+ export HOMEBREW_GIT_CONFIG_FILE="$HOMEBREW_REPOSITORY/.git/config"
+ HOMEBREW_GIT_CONFIG_DEVELOPERMODE="$(git config --file="$HOMEBREW_GIT_CONFIG_FILE" --get homebrew.devcmdrun 2>/dev/null)"
+ if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]]
+ then
+ export HOMEBREW_DEV_CMD_RUN="1"
+ fi
+fi
+
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]
then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"