aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2016-09-05 21:31:34 +0100
committerMike McQuaid2016-09-08 20:44:32 +0100
commit42c2ed5e7f1aa8adc719a095a753c248c0ecbee0 (patch)
tree6ceffc43a9f39d4262594c98ef791b70cb6d1888 /Library
parentf37d004ab5588d7b24a593ad8619f024b8c91a6b (diff)
downloadbrew-42c2ed5e7f1aa8adc719a095a753c248c0ecbee0.tar.bz2
brew.sh: set HOMEBREW_DEVELOPER from Git config.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 1651e8262..5e36ac54a 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -191,6 +191,16 @@ case "$HOMEBREW_COMMAND" in
--config) HOMEBREW_COMMAND="config" ;;
esac
+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.developermode)"
+ if [[ "$HOMEBREW_GIT_CONFIG_DEVELOPERMODE" = "true" ]]
+ then
+ export HOMEBREW_DEVELOPER="1"
+ fi
+fi
+
if [[ -f "$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh" ]]
then
HOMEBREW_BASH_COMMAND="$HOMEBREW_LIBRARY/Homebrew/cmd/$HOMEBREW_COMMAND.sh"