Also check for .bash_profile

This commit is contained in:
Julian Ospald 2019-08-22 15:37:20 +08:00
parent 612e0e1ee2
commit 5c1d71154d
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 17 additions and 0 deletions

View File

@ -103,6 +103,23 @@ if [ -e "$HOME/.bashrc" ] ; then
*)
exit 0;;
esac
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"
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
case $next_answer in
[Yy]*)
echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bash_profile"
;;
*)
exit 0;;
esac
fi
)