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

This commit is contained in:
Julian Ospald 2019-11-13 11:05:44 +08:00
commit c72fac8d17
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 58 additions and 45 deletions

View File

@ -100,14 +100,28 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
GHCUP_PROFILE_FILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ] ; then
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
else
# most complaints we get are from mac users who
# need assistance of setting up their shell, so suggest
# to create .bash_profile, which is a good guess
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
fi
if [ -n "${GHCUP_PROFILE_FILE}" ] && [ -f "${GHCUP_PROFILE_FILE}" ] ; then
if [ -f "${GHCUP_PROFILE_FILE}" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected \"${GHCUP_PROFILE_FILE}\" on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your \"${GHCUP_PROFILE_FILE}\" to include the required PATH variable"
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES, otherwise with NO and press ENTER."
printf "\\033[0;35m%s\\033[0m\\n" ""
elif [ -n "${BASH}" ] ; then # only suggest to create .bash_profile if we are in a bash shell
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected bash shell on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically create \"${GHCUP_PROFILE_FILE}\" and include the required PATH variable"
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES, otherwise with NO and press ENTER."
printf "\\033[0;35m%s\\033[0m\\n" ""
else
exit 0
fi
while true; do
read -r next_answer </dev/tty
@ -123,7 +137,6 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
esac
done
fi
fi
)
# vim: tabstop=4 shiftwidth=4 expandtab