kloeckner.com.ar

a backup of my entire webpage
Index Commits Files Refs README LICENSE
commit 6131e81aa3aecddc702dc2ec2a3598132233fbf9
parent 7a31279bd7a59200281ccf8cf64e90e80155cb6b
Author: mjkloeckner <martinjkloeckner@gmail.com>
Date:   Sun, 18 Feb 2024 00:46:48 -0300

Add option to force generate scripts

Also fix indentation not uniform

Diffstat:
MMakefile | 6+++++-
Mscripts/sync.sh | 8++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
@@ -9,7 +9,11 @@ build:
     ./scripts/sync.sh ${ROOT_PATH}
 
 sync: build
-    ./scripts/sync.sh
+    sudo ./scripts/deploy_local.sh ${ROOT_PATH}
+
+force-sync:
+    ./scripts/build.sh ${ROOT_PATH}
+    ./scripts/sync.sh --force-update ${ROOT_PATH}
     sudo ./scripts/deploy_local.sh ${ROOT_PATH}
 
 deploy:
diff --git a/scripts/sync.sh b/scripts/sync.sh
@@ -27,7 +27,9 @@ generate_blog_index() {
         fi
     done
 
-    $update || echo "     └─ Blog index file up to date" && return 1
+    [ ! -z "$1" ] && update=true;
+    [ "$update" = "false" ] && echo \"     └─ Blog index file up to date\" && return 1
+    echo "     └─ Updating blog index"
 
     rm -rf $root_folder/$blog_index_file ||:
     touch $root_folder/$blog_index_file
@@ -138,6 +140,8 @@ else
 fi
 
 case "$1" in
-    --force-rss) echo "+ generate_rss_feed"; generate_rss_feed;;
+    --force-update) 
+        echo "+ generate_rss_feed"; generate_rss_feed;
+        echo "+ generate_blog_index"; generate_blog_index "force-update";;
     *) echo "+ check_rss_feed_last_build"; check_rss_feed_last_build;;
 esac