From 7f16cec968c3c8d4e580267fb00195916d6f827d Mon Sep 17 00:00:00 2001 From: Carl-Erik Kopseng Date: Sun, 30 Jan 2022 17:26:53 +0100 Subject: [PATCH] Enable updates to same major version --- scripts/copy-documentation-for-new-release.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/copy-documentation-for-new-release.sh b/scripts/copy-documentation-for-new-release.sh index 0327d9915..12310b701 100755 --- a/scripts/copy-documentation-for-new-release.sh +++ b/scripts/copy-documentation-for-new-release.sh @@ -2,6 +2,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "$SCRIPT_DIR/.." +#exit on error +set -e + if [[ $# != 1 ]]; then echo "Usage: $0 " exit 1 @@ -17,14 +20,12 @@ function copy_source_to(){ local FILE_PATH="${DIR}.md" if [ -e "$DIR" ]; then - echo "$DIR already exists, cannot continue" - exit 1 + echo "$DIR already exists, removing it for update" + rm -r "$DIR" fi - if [ -e "$FILE_PATH" ] - then - echo "$FILE_PATH already exists, cannot continue" - exit 1 + if [ -e "$FILE_PATH" ]; then + rm -r "$FILE_PATH" fi echo "Copy $SOURCE_PATH to $DIR"