Improve message when no GHC is installed

This commit is contained in:
Julian Ospald 2018-10-01 12:28:24 +08:00
parent 7d9631c7e4
commit ba80c6e409
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 6 additions and 2 deletions

8
ghcup
View File

@ -720,8 +720,12 @@ show_ghc() {
echo "Installed GHCs:"
for i in "${GHC_LOCATION}"/* ; do
[ -e "${i}" ] || die "Something went wrong, ${i} does not exist!"
echo " $(basename "${i}")"
if [ -e "${i}" ] ; then
echo " $(basename "${i}")"
else # directory is empty
echo " None"
exit 0
fi
done
if [ -n "${current_ghc}" ] ; then