From 82a0b1e5e5ee350f6acfb338e47007023a80e62f Mon Sep 17 00:00:00 2001 From: Logicer Date: Fri, 20 Dec 2024 16:03:42 +1100 Subject: [PATCH] remove temp directory if cloned successfully --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 40a88f6..3557b1c 100755 --- a/install.sh +++ b/install.sh @@ -2,8 +2,8 @@ ( cd /tmp/ && \ git clone https://github.com/Logicer16/pam-watchid.git && \ -cd "$(basename "$_" .git)" && \ -make $1 && \ +cd "$(basename "$_" .git)" && CLONE_SUCCESS="true" && \ +make $1 # cleanup -TMP=`pwd -P` && cd "`dirname $TMP`" && rm -rf "./`basename $TMP`" && unset TMP +[[ "$CLONE_SUCCESS" == "true" ]] && TMP=`pwd -P` && cd "`dirname $TMP`" && rm -rf "./`basename $TMP`" && unset TMP )