Skip adjusting PATH if in noninteractive mode.

This commit is contained in:
Alex McLean 2019-10-15 17:24:15 -04:00
parent 6a126e6bfe
commit 205d7e84f5

View File

@ -82,11 +82,13 @@ edo cabal new-update
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Installation done!"
printf "\\033[0;35m%s\\033[0m\\n" ""
echo "In order to run ghc and cabal, you need to adjust your PATH variable."
echo "You may want to source '$GHCUP_INSTALL_BASE_PREFIX/.ghcup/env' in your shell"
echo "configuration to do so (e.g. ~/.bashrc)."
if [ -e "$HOME/.bashrc" ] ; then
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo "In order to run ghc and cabal, you need to adjust your PATH variable."
echo "You may want to source '$GHCUP_INSTALL_BASE_PREFIX/.ghcup/env' in your shell"
echo "configuration to do so (e.g. ~/.bashrc)."
if [ -e "$HOME/.bashrc" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bashrc on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bashrc to include the required PATH variable"
@ -103,7 +105,7 @@ if [ -e "$HOME/.bashrc" ] ; then
*)
exit 0;;
esac
elif [ -e "$HOME/.bash_profile" ] ; then
elif [ -e "$HOME/.bash_profile" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bash_profile on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bash_profile to include the required PATH variable"
@ -120,8 +122,8 @@ elif [ -e "$HOME/.bash_profile" ] ; then
*)
exit 0;;
esac
fi
fi
)
# vim: tabstop=4 shiftwidth=4 expandtab