1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Don't delete an existing directory and clone our repo in its place. TODO: Something more robust

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
Adam Warner 2020-12-02 20:19:59 +00:00
parent a217c75134
commit 61f13a334d
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173

View File

@ -528,8 +528,8 @@ make_repo() {
printf " %b %s..." "${INFO}" "${str}" printf " %b %s..." "${INFO}" "${str}"
# If the directory exists, # If the directory exists,
if [[ -d "${directory}" ]]; then if [[ -d "${directory}" ]]; then
# delete everything in it so git can clone into it # 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
rm -rf "${directory}" return 1
fi fi
# Clone the repo and return the return code from this command # Clone the repo and return the return code from this command
git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $? git clone -q --depth 20 "${remoteRepo}" "${directory}" &> /dev/null || return $?