Remove dangling ghc, ghci, ... symlinks after removal of active GHC
This commit is contained in:
parent
5bb5389192
commit
83cc66365b
16
ghcup
16
ghcup
@ -885,7 +885,21 @@ rm_ghc() {
|
|||||||
status_message "Successfully removed GHC ${myghcver}."
|
status_message "Successfully removed GHC ${myghcver}."
|
||||||
|
|
||||||
if [ ! -e "${BIN_LOCATION}"/ghc ] ; then
|
if [ ! -e "${BIN_LOCATION}"/ghc ] ; then
|
||||||
warning_message "Currently active GHC is a dangling symlink, run:"
|
warning_message "Currently active GHC is a dangling symlink, removing..."
|
||||||
|
|
||||||
|
# TODO: known_tools is not very robust, but we want to avoid accidentially deleting
|
||||||
|
# unrelated things (even if those are dangling symlinks)
|
||||||
|
known_tools="ghc ghci ghc-pkg haddock-ghc runghc runhaskell"
|
||||||
|
# remove dangling symlinks for ghc, ghci, ...
|
||||||
|
for t in ${known_tools} ; do
|
||||||
|
if [ -h "${BIN_LOCATION}/${t}" ] && [ ! -e "${BIN_LOCATION}/${t}" ] ; then
|
||||||
|
edo rm "${BIN_LOCATION}/${t}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset t known_tools
|
||||||
|
|
||||||
|
warning_message "Done."
|
||||||
|
warning_message "You may now want to set currently active GHC to a different version via:"
|
||||||
warning_message " ghcup set <ghcver>"
|
warning_message " ghcup set <ghcver>"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user