Merge remote-tracking branch 'origin/merge-requests/121'

This commit is contained in:
Julian Ospald 2019-10-21 10:58:30 +08:00
commit 53b2924850
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -82,46 +82,48 @@ edo cabal new-update
printf "\\033[0;35m%s\\033[0m\\n" "" 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" "Installation done!"
printf "\\033[0;35m%s\\033[0m\\n" "" 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
printf "\\033[0;35m%s\\033[0m\\n" "" echo "In order to run ghc and cabal, you need to adjust your PATH variable."
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bashrc on your system..." echo "You may want to source '$GHCUP_INSTALL_BASE_PREFIX/.ghcup/env' in your shell"
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bashrc to include the required PATH variable" echo "configuration to do so (e.g. ~/.bashrc)."
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort."
printf "\\033[0;35m%s\\033[0m\\n" ""
read -r next_answer </dev/tty 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"
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort."
printf "\\033[0;35m%s\\033[0m\\n" ""
case $next_answer in read -r next_answer </dev/tty
[Yy]*)
echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bashrc" case $next_answer in
;; [Yy]*)
*) echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bashrc"
exit 0;; ;;
esac *)
elif [ -e "$HOME/.bash_profile" ] ; then exit 0;;
printf "\\033[0;35m%s\\033[0m\\n" "" esac
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bash_profile on your system..." elif [ -e "$HOME/.bash_profile" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bash_profile to include the required PATH variable" printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)." printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bash_profile on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort." printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bash_profile to include the required PATH variable"
printf "\\033[0;35m%s\\033[0m\\n" "" printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort."
printf "\\033[0;35m%s\\033[0m\\n" ""
read -r next_answer </dev/tty read -r next_answer </dev/tty
case $next_answer in case $next_answer in
[Yy]*) [Yy]*)
echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bash_profile" echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bash_profile"
;; ;;
*) *)
exit 0;; exit 0;;
esac esac
fi
fi fi
) )
# vim: tabstop=4 shiftwidth=4 expandtab # vim: tabstop=4 shiftwidth=4 expandtab