From 371fdd6652d87fd9c9d05f1bf236dd9b3cc88e6a Mon Sep 17 00:00:00 2001 From: Carles Pina i Estany Date: Mon, 25 Oct 2021 23:47:44 +0100 Subject: [PATCH] Avoid unneeded check --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 536b5a5..3ad65e4 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -42,11 +42,12 @@ TEMP_DIR=$(mktemp -d) mv "$CLONE_DIR/.git" "$TEMP_DIR/.git" echo "[+] Checking if $TARGET_DIRECTORY exist in git repo $DESTINATION_REPOSITORY_NAME" + # Remove contents of target directory and create a new empty one if [ -d "$CLONE_DIR/$TARGET_DIRECTORY/" ] then echo "[+] Deleting files from $TARGET_DIRECTORY in git repo $DESTINATION_REPOSITORY_NAME" - rm -R "${CLONE_DIR:?}/$TARGET_DIRECTORY/" + rm -R "$CLONE_DIR/$TARGET_DIRECTORY/" fi echo "[+] Creating $TARGET_DIRECTORY if doesnt already exist" mkdir -p "$CLONE_DIR/$TARGET_DIRECTORY"