From e22ed9dbe2817ab4a4fa971b9b7dd1e1015e0db8 Mon Sep 17 00:00:00 2001 From: Jan Felix Langenbach Date: Tue, 3 Dec 2019 23:34:06 +0100 Subject: [PATCH] Add check to removal of link to share --- ghcup | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ghcup b/ghcup index 12b90bd..d911dd6 100755 --- a/ghcup +++ b/ghcup @@ -1657,8 +1657,10 @@ rm_ghc() { fi done unset t known_tools - # remove share directory - edo rm "${BIN_LOCATION}/../share" + # remove dangling symlink to share directory + if [ -h "${BIN_LOCATION}/../share" ] && [ ! -e "${BIN_LOCATION}/../share" ] ; then + edo rm "${BIN_LOCATION}/../share" + fi warning_message "Done." warning_message "You may now want to set currently active GHC to a different version via:"