brew.sh: Move HOMEBREW_TEMP declaration

Additionally, assign HOMEBREW_TEMP based on the host
system (/tmp for Linux, /private/tmp for macOS).
This commit is contained in:
William Woodruff 2018-07-01 12:58:32 -04:00
parent a8bcb5dfa4
commit 039a4ee4b3
No known key found for this signature in database
GPG Key ID: 600D68320BE45ACC
2 changed files with 4 additions and 1 deletions

View File

@ -108,6 +108,8 @@ then
then
HOMEBREW_CACHE="$HOME/Library/Caches/Homebrew"
fi
HOMEBREW_TEMP="${HOMEBREW_TEMP:-/private/tmp}"
else
HOMEBREW_PROCESSOR="$(uname -m)"
HOMEBREW_PRODUCT="${HOMEBREW_SYSTEM}brew"
@ -124,6 +126,8 @@ else
HOMEBREW_CACHE="$HOME/.cache/Homebrew"
fi
fi
HOMEBREW_TEMP="${HOMEBREW_TEMP:-/tmp}"
fi
if [[ -n "$HOMEBREW_FORCE_BREWED_CURL" &&

View File

@ -21,7 +21,6 @@ symlink_target_directory() {
BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd -P)"
HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}"
HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"
HOMEBREW_TEMP="${HOMEBREW_TEMP:-/private/tmp}"
# Default to / prefix if unset or the bin/brew file.
if [[ -z "$HOMEBREW_PREFIX" || "$HOMEBREW_PREFIX" = "$HOMEBREW_BREW_FILE" ]]