From f7eae69b59ba1716a9aca2bc006192f378e963f0 Mon Sep 17 00:00:00 2001 From: Yuki Joou Date: Fri, 18 Aug 2023 17:02:30 +0200 Subject: [PATCH] Prompt for removal of old data --- site-inator | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site-inator b/site-inator index 1dc65b6..27019a4 100755 --- a/site-inator +++ b/site-inator @@ -65,6 +65,9 @@ echo ' Website generation will commence now!'; echo; echo; +echo "Removing old data at $OUTPUT_PATH"; +rm -rI $OUTPUT_PATH/; + for file in $(find $SOURCES_PATH/ -iname '*.html'); do clean_path="${file#$SOURCES_PATH/}" @@ -83,6 +86,6 @@ done; echo 'Generation: done!' -[[ -e $STATIC_RESOURCES_PATH/ ]] && (echo "Copying static assets..." && find $STATIC_RESOURCES_PATH/ -maxdepth 1 -exec cp -r {} $OUTPUT_PATH/ ';') +[[ -e $STATIC_RESOURCES_PATH/ ]] && (echo "Copying static assets..." && find $STATIC_RESOURCES_PATH/ -maxdepth 1 -mindepth 1 -exec cp -r {} $OUTPUT_PATH/ ';') echo "Check $OUTPUT_PATH/ for the processed files"