From 99232da3a1c16ca821277d265814915b5da80857 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Sun, 10 Mar 2024 22:23:33 +0100 Subject: [PATCH] Will now check for symlinks too --- buildtool.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildtool.sh b/buildtool.sh index cd691f2..b5f16fb 100755 --- a/buildtool.sh +++ b/buildtool.sh @@ -286,10 +286,10 @@ function ask_debug() { } ## Ask for clone directory conflict resolution (includes check) function ask_clonedir_conflictresolution() { - if [ ! -d "${BUILDTOOL_CLONEDIR}" ]; then + if [ ! -d "${BUILDTOOL_CLONEDIR}" ] && [ ! -L "${BUILDTOOL_CLONEDIR}" ]; then return - elif [ -a "${BUILDTOOL_CLONEDIR}" ] && [ ! -d "${BUILDTOOL_CLONEDIR}" ]; then - warnh "Something that isn't a directory exists at location \"${BUILDTOOL_CLONEDIR}\"" + elif [ -a "${BUILDTOOL_CLONEDIR}" ] && [ ! -d "${BUILDTOOL_CLONEDIR}" ] && [ ! -L "${BUILDTOOL_CLONEDIR}" ]; then + warnh "Something that isn't a directory or symlink exists at location \"${BUILDTOOL_CLONEDIR}\"" fi read -rp "$(infoh "Warning: \"${BUILDTOOL_CLONEDIR}\" already exists. What should be done to resolve the conflict [A(bort)/r(ecompile)/f(resh)]? ")" BUILDTOOL_CLONEDIR_CONFLICT case "${BUILDTOOL_CLONEDIR_CONFLICT}" in @@ -302,7 +302,7 @@ function ask_clonedir_conflictresolution() { ;; "f"|"F") infoh "Removing existing \$BUILDTOOL_CLONEDIR directory" - #rm -rf "${BUILDTOOL_CLONEDIR}" + rm -rf "${BUILDTOOL_CLONEDIR}" ;; *) errorh "Invalid answer. Please answer with Y, N or I."