From 6eb642bda267b1382795b256ec1e26631a65b91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sun, 4 Feb 2024 13:28:46 +0100 Subject: [PATCH] qsgen2: Add option force --- qsgen2 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/qsgen2 b/qsgen2 index 14ab25d..e430857 100755 --- a/qsgen2 +++ b/qsgen2 @@ -36,6 +36,10 @@ function include () { # Including some colors to the script include common/colors +# Define cache files for blogs and pages +blog_cache_file="${project_dir}/.blog_cache" +pages_cache_file="${project_dir}/.pages_cache" + echo "${magenta}${blue_bg} ${QSGEN} ${end}${white}${blue_bg}${VERSION} ${end}" _add_site() { @@ -97,7 +101,10 @@ case "$1" in _list_sites exit ;; - # Add cases for other commands like init, list, remove here + force) + : >| "$blog_cache_file" # Truncate the blog cache before doing update + : >| "$pages_cache_file" # Truncate the page cache before doing update + ;; *) echo "Usage: qsgen2 [command]" exit @@ -197,10 +204,6 @@ fi if (${debug}); then _msg debug "Using the ${generator} engine for files: ${file_ext}"; fi -# Define cache files for blogs and pages -blog_cache_file="${project_dir}/.blog_cache" -pages_cache_file="${project_dir}/.pages_cache" - builtin cd ${project_dir} # Let's put these here for now.