From 57578cf91ac91150af43d5216ec2cf3a00089e99 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera Date: Sat, 13 Sep 2025 13:29:36 +0800 Subject: [PATCH] Fix `path_helper` usage The output of `path_helper` needs to be `eval`ed for it to work. --- Library/Homebrew/cmd/shellenv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/shellenv.sh b/Library/Homebrew/cmd/shellenv.sh index df5ad65fb3..20f52455d4 100644 --- a/Library/Homebrew/cmd/shellenv.sh +++ b/Library/Homebrew/cmd/shellenv.sh @@ -50,7 +50,7 @@ homebrew-shellenv() { echo "setenv HOMEBREW_REPOSITORY ${HOMEBREW_REPOSITORY};" if [[ -n "${PATH_HELPER_ROOT}" ]] then - echo "PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -c" + echo "eval \`PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -c\`;" else echo "setenv PATH ${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:\$PATH;" fi @@ -75,7 +75,7 @@ homebrew-shellenv() { fi if [[ -n "${PATH_HELPER_ROOT}" ]] then - echo "PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -s" + echo "eval \"\$(PATH_HELPER_ROOT=\"${PATH_HELPER_ROOT}\" /usr/libexec/path_helper -s)\"" else echo "export PATH=\"${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin\${PATH+:\$PATH}\";" fi