aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh
index 241fa1c2e..1e2b0f3ed 100644
--- a/Library/Homebrew/brew.sh
+++ b/Library/Homebrew/brew.sh
@@ -69,9 +69,15 @@ then
odie "Cowardly refusing to continue at this prefix: $HOMEBREW_PREFIX"
fi
-# Save value to use for installing gems
-export HOMEBREW_GEM_HOME="$GEM_HOME"
-export HOMEBREW_GEM_PATH="$GEM_PATH"
+# Save values to use for installing gems
+if [[ -n "$GEM_HOME" ]]
+then
+ export HOMEBREW_GEM_HOME="$GEM_HOME"
+fi
+if [[ -n "$GEM_PATH" ]]
+then
+ export HOMEBREW_GEM_PATH="$GEM_PATH"
+fi
# Users may have these set, pointing the system Ruby
# at non-system gem paths
@@ -308,9 +314,6 @@ update-preinstall() {
[[ -z "$HOMEBREW_NO_AUTO_UPDATE" ]] || return
[[ -z "$HOMEBREW_UPDATE_PREINSTALL" ]] || return
- # Allow auto-update migration now we have a fix in place (below in this function).
- export HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION="1"
-
if [[ "$HOMEBREW_COMMAND" = "install" || "$HOMEBREW_COMMAND" = "upgrade" || "$HOMEBREW_COMMAND" = "tap" ]]
then
if [[ -z "$HOMEBREW_VERBOSE" ]]
@@ -319,6 +322,9 @@ update-preinstall() {
timer_pid=$!
fi
+ # Allow auto-update migration now we have a fix in place (below in this function).
+ export HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION="1"
+
brew update --preinstall
if [[ -n "$timer_pid" ]]