From 61f13a334d2fb7ca81a3a47c7d9fc599a72d9164 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 2 Dec 2020 20:19:59 +0000 Subject: [PATCH 1/3] Don't delete an existing directory and clone our repo in its place. TODO: Something more robust Signed-off-by: Adam Warner --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index bab6471e..5470a9fb 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -528,8 +528,8 @@ make_repo() { printf " %b %s..." "${INFO}" "${str}" # If the directory exists, if [[ -d "${directory}" ]]; then - # delete everything in it so git can clone into it - rm -rf "${directory}" + # Return with a 1 to exit the installer. We don't want to overwrite what could already be here in case it is not ours + return 1 fi # Clone the repo and return the return code from this command git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $? From 641951b3a041a0a99c295fc977a1edef9fb87262 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 2 Dec 2020 20:35:40 +0000 Subject: [PATCH 2/3] add some meaningful outputSigned-off-by: Adam Warner --- automated install/basic-install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5470a9fb..9d5b4465 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -529,6 +529,8 @@ make_repo() { # If the directory exists, if [[ -d "${directory}" ]]; then # Return with a 1 to exit the installer. We don't want to overwrite what could already be here in case it is not ours + str="Unable to clone ${remoteRepo} into ${directory}" + printf "%b %b%s\\n" "${OVER}" "${CROSS}" "${str}" return 1 fi # Clone the repo and return the return code from this command From e47eb30a6e269895346dd4299591c930e631388f Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 2 Dec 2020 20:49:07 +0000 Subject: [PATCH 3/3] Update automated install/basic-install.sh Signed-off-by: Adam Warner --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9d5b4465..45e96354 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -529,7 +529,7 @@ make_repo() { # If the directory exists, if [[ -d "${directory}" ]]; then # Return with a 1 to exit the installer. We don't want to overwrite what could already be here in case it is not ours - str="Unable to clone ${remoteRepo} into ${directory}" + str="Unable to clone ${remoteRepo} into ${directory} : Directory already exists" printf "%b %b%s\\n" "${OVER}" "${CROSS}" "${str}" return 1 fi