From 61f13a334d2fb7ca81a3a47c7d9fc599a72d9164 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 2 Dec 2020 20:19:59 +0000 Subject: [PATCH] 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 $?