diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index de85379827..8b729da6ad 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -13,17 +13,6 @@ case "${HOMEBREW_SYSTEM}" in Linux) HOMEBREW_LINUX="1" ;; esac -# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local -# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY. -# These variables are set by bin/brew -# shellcheck disable=SC2154 -if [[ -d "${HOMEBREW_REPOSITORY}/Cellar" ]] -then - HOMEBREW_CELLAR="${HOMEBREW_REPOSITORY}/Cellar" -else - HOMEBREW_CELLAR="${HOMEBREW_PREFIX}/Cellar" -fi - HOMEBREW_MACOS_ARM_DEFAULT_PREFIX="/opt/homebrew" HOMEBREW_MACOS_ARM_DEFAULT_REPOSITORY="${HOMEBREW_MACOS_ARM_DEFAULT_PREFIX}" HOMEBREW_LINUX_DEFAULT_PREFIX="/home/linuxbrew/.linuxbrew" @@ -55,6 +44,17 @@ else HOMEBREW_DEFAULT_TEMP="/tmp" fi +# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local +# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY. +# These variables are set by bin/brew +# shellcheck disable=SC2154 +if [[ -d "${HOMEBREW_REPOSITORY}/Cellar" ]] +then + HOMEBREW_CELLAR="${HOMEBREW_REPOSITORY}/Cellar" +else + HOMEBREW_CELLAR="${HOMEBREW_PREFIX}/Cellar" +fi + HOMEBREW_CACHE="${HOMEBREW_CACHE:-${HOMEBREW_DEFAULT_CACHE}}" HOMEBREW_LOGS="${HOMEBREW_LOGS:-${HOMEBREW_DEFAULT_LOGS}}" HOMEBREW_TEMP="${HOMEBREW_TEMP:-${HOMEBREW_DEFAULT_TEMP}}" diff --git a/bin/brew b/bin/brew index afc02e9eb8..3732948067 100755 --- a/bin/brew +++ b/bin/brew @@ -40,7 +40,7 @@ do done unset cmd -BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd -P)" +BREW_FILE_DIRECTORY="$(quiet_cd "${0%/*}/" && pwd)" HOMEBREW_BREW_FILE="${BREW_FILE_DIRECTORY%/}/${0##*/}" HOMEBREW_PREFIX="${HOMEBREW_BREW_FILE%/*/*}"