From ba80c6e409e6ef0d6bdb4f5563b66859b06e5128 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 1 Oct 2018 12:28:24 +0800 Subject: [PATCH] Improve message when no GHC is installed --- ghcup | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ghcup b/ghcup index 5461469..72d7066 100755 --- a/ghcup +++ b/ghcup @@ -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