From 6f70844708304c69a9da71c035b19d72ca732376 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sat, 29 Sep 2018 23:55:33 +0800 Subject: [PATCH] Fix mkdir of target location --- ghcup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghcup.sh b/ghcup.sh index c546550..5396d4b 100755 --- a/ghcup.sh +++ b/ghcup.sh @@ -274,8 +274,6 @@ install_ghc() { download_url=$(get_download_url "${myghcver}") download_tarball_name=$(basename "${download_url}") - [ -e "${target_location}" ] || mkdir "${target_location}" - if [ -e "${inst_location}" ] ; then if ${FORCE} ; then echo "GHC already installed in ${inst_location}, overwriting!" @@ -312,6 +310,8 @@ install_ghc() { die "Failed to install" } + [ -e "${target_location}" ] || mkdir "${target_location}" + for f in "${inst_location}"/bin/*-"${myghcver}" ; do [ -e "${f}" ] || die "Something went wrong, ${f} does not exist!" fn=$(basename "${f}")