Skip to content

Commit

Permalink
shellenv: fix MANPATH and INFOPATH handling for [t]csh
Browse files Browse the repository at this point in the history
It turns out that control flow in csh is a pain. But we can rely on
`test`, which is thankfully POSIX.

Closes #17949.
  • Loading branch information
carlocab committed Aug 3, 2024
1 parent 4dcd308 commit 3fec77e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/shellenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ homebrew-shellenv() {
echo "setenv HOMEBREW_CELLAR ${HOMEBREW_CELLAR};"
echo "setenv HOMEBREW_REPOSITORY ${HOMEBREW_REPOSITORY};"
echo "setenv PATH ${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin:\$PATH;"
echo "if ( \${?MANPATH} == 1 ) setenv MANPATH :\${MANPATH};"
echo "setenv INFOPATH ${HOMEBREW_PREFIX}/share/info\`if ( \${?INFOPATH} == 1 ) echo \":\${INFOPATH}\"\`;"
echo "test \${?MANPATH} -eq 1 && setenv MANPATH :\${MANPATH};"
echo "setenv INFOPATH ${HOMEBREW_PREFIX}/share/info\`test \${?INFOPATH} -eq 1 && echo :\${INFOPATH}\`;"
;;
pwsh | -pwsh | pwsh-preview | -pwsh-preview)
echo "[System.Environment]::SetEnvironmentVariable('HOMEBREW_PREFIX','${HOMEBREW_PREFIX}',[System.EnvironmentVariableTarget]::Process)"
Expand Down

0 comments on commit 3fec77e

Please sign in to comment.