File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1072,6 +1072,7 @@ EOS
10721072ohai " Next steps:"
10731073case " ${SHELL} " in
10741074 * /bash* )
1075+ shellenv_suffix=" bash"
10751076 if [[ -n " ${HOMEBREW_ON_LINUX-} " ]]
10761077 then
10771078 shell_rcfile=" ${HOME} /.bashrc"
@@ -1080,6 +1081,7 @@ case "${SHELL}" in
10801081 fi
10811082 ;;
10821083 * /zsh* )
1084+ shellenv_suffix=" zsh"
10831085 if [[ -n " ${HOMEBREW_ON_LINUX-} " ]]
10841086 then
10851087 shell_rcfile=" ${ZDOTDIR:- " ${HOME} " } /.zshrc"
@@ -1088,28 +1090,30 @@ case "${SHELL}" in
10881090 fi
10891091 ;;
10901092 * /fish* )
1093+ shellenv_suffix=" fish"
10911094 shell_rcfile=" ${HOME} /.config/fish/config.fish"
10921095 ;;
10931096 * )
1097+ shellenv_suffix=" "
10941098 shell_rcfile=" ${ENV:- " ${HOME} /.profile" } "
10951099 ;;
10961100esac
10971101
1098- if grep -qs " eval \"\$ (${HOMEBREW_PREFIX} /bin/brew shellenv)\" " " ${shell_rcfile} "
1102+ if grep -qs " eval \"\$ (${HOMEBREW_PREFIX} /bin/brew shellenv[^ \" ]* )\" " " ${shell_rcfile} "
10991103then
11001104 if ! [[ -x " $( command -v brew) " ]]
11011105 then
11021106 cat << EOS
11031107- Run this command in your terminal to add Homebrew to your ${tty_bold} PATH${tty_reset} :
1104- eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv)"
1108+ eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv${shellenv_suffix} )"
11051109EOS
11061110 fi
11071111else
11081112 cat << EOS
11091113- Run these commands in your terminal to add Homebrew to your ${tty_bold} PATH${tty_reset} :
11101114 echo >> ${shell_rcfile}
1111- echo 'eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv)"' >> ${shell_rcfile}
1112- eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv)"
1115+ echo 'eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv${shellenv_suffix} )"' >> ${shell_rcfile}
1116+ eval "\$ (${HOMEBREW_PREFIX} /bin/brew shellenv${shellenv_suffix} )"
11131117EOS
11141118fi
11151119
You can’t perform that action at this time.
0 commit comments