[fix] Improve shell detection in shellenv

$SHELL is set to only the binary name in some environments (e.g. fish, not /usr/bin/fish), causing detection of fish/csh/tsch to fail without this change.
This commit is contained in:
Niklas Herder 2020-04-29 08:20:06 +02:00
parent 3d9cf83fec
commit 2f4d4b8684
No known key found for this signature in database
GPG Key ID: 1726B191966073BA

View File

@ -7,7 +7,7 @@
homebrew-shellenv() {
case "$SHELL" in
*/fish)
*/fish|fish)
echo "set -gx HOMEBREW_PREFIX \"$HOMEBREW_PREFIX\";"
echo "set -gx HOMEBREW_CELLAR \"$HOMEBREW_CELLAR\";"
echo "set -gx HOMEBREW_REPOSITORY \"$HOMEBREW_REPOSITORY\";"
@ -15,7 +15,7 @@ homebrew-shellenv() {
echo "set -q MANPATH; or set MANPATH ''; set -gx MANPATH \"$HOMEBREW_PREFIX/share/man\" \$MANPATH;"
echo "set -q INFOPATH; or set INFOPATH ''; set -gx INFOPATH \"$HOMEBREW_PREFIX/share/info\" \$INFOPATH;"
;;
*/csh|*/tcsh)
*/csh|csh|*/tcsh|tcsh)
echo "setenv HOMEBREW_PREFIX $HOMEBREW_PREFIX;"
echo "setenv HOMEBREW_CELLAR $HOMEBREW_CELLAR;"
echo "setenv HOMEBREW_REPOSITORY $HOMEBREW_REPOSITORY;"