diff --git a/Library/Homebrew/cmd/shellenv.sh b/Library/Homebrew/cmd/shellenv.sh index 5c27621515..d7678d56ee 100644 --- a/Library/Homebrew/cmd/shellenv.sh +++ b/Library/Homebrew/cmd/shellenv.sh @@ -11,7 +11,7 @@ # shellcheck disable=SC2154 homebrew-shellenv() { if [[ "${HOMEBREW_SHELLENV_PREFIX}" == "${HOMEBREW_PREFIX}" ]] && - [[ "$(PATH="${HOMEBREW_PATH}" command -v brew)" == "${HOMEBREW_PREFIX}/bin/brew" ]] + [[ "${HOMEBREW_PATH%%/usr/bin:*}" == *"${HOMEBREW_PREFIX}/bin"* ]] then return fi