cmd/shellenv.sh: handle undefined MANPATH and set -eu.

See https://github.com/Homebrew/brew/pull/17633#issuecomment-2218657931
This commit is contained in:
Mike McQuaid 2024-07-11 08:17:11 +01:00
parent 4bcdd81657
commit d187f2d6cc
No known key found for this signature in database

View File

@ -57,7 +57,7 @@ homebrew-shellenv() {
echo "export HOMEBREW_CELLAR=\"${HOMEBREW_CELLAR}\";"
echo "export HOMEBREW_REPOSITORY=\"${HOMEBREW_REPOSITORY}\";"
echo "export PATH=\"${HOMEBREW_PREFIX}/bin:${HOMEBREW_PREFIX}/sbin\${PATH+:\$PATH}\";"
echo "[ -z \"\${MANPATH}\" ] || export MANPATH=\":\${MANPATH#:}\";"
echo "[ -z \"\${MANPATH-}\" ] || export MANPATH=\":\${MANPATH#:}\";"
echo "export INFOPATH=\"${HOMEBREW_PREFIX}/share/info:\${INFOPATH:-}\";"
;;
esac