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

View File

@ -100,14 +100,28 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
GHCUP_PROFILE_FILE="$HOME/.bashrc" GHCUP_PROFILE_FILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ] ; then elif [ -f "$HOME/.bash_profile" ] ; then
GHCUP_PROFILE_FILE="$HOME/.bash_profile" 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 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" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected \"${GHCUP_PROFILE_FILE}\" on your system..." 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" "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" "answer with YES, otherwise with NO and press ENTER."
printf "\\033[0;35m%s\\033[0m\\n" "" 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 while true; do
read -r next_answer </dev/tty read -r next_answer </dev/tty
@ -122,7 +136,6 @@ if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo "Please type YES or NO and press enter.";; echo "Please type YES or NO and press enter.";;
esac esac
done done
fi
fi fi
) )