From f71bf2fd519a7cec9cef87fa5064904baff02b90 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 27 Oct 2018 16:41:23 +0800 Subject: [PATCH] Fix dangling GHC symlink check --- ghcup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghcup b/ghcup index 5587062..731043e 100755 --- a/ghcup +++ b/ghcup @@ -917,7 +917,7 @@ rm_ghc() { status_message "Successfully removed GHC ${myghcver}." - if [ ! -e "${BIN_LOCATION}"/ghc ] ; then + if [ -h "${BIN_LOCATION}/ghc" ] && [ ! -e "${BIN_LOCATION}/ghc" ] ; then warning_message "Currently active GHC is a dangling symlink, removing..." # TODO: known_tools is not very robust, but we want to avoid accidentially deleting