From b5dd211ed5bedfbfed789fecbc4c88c3d456b7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sun, 4 Feb 2024 18:46:23 +0100 Subject: [PATCH] qsgen2: Add message when running in force mode --- qsgen2 | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/qsgen2 b/qsgen2 index 5ddde43..1d16468 100755 --- a/qsgen2 +++ b/qsgen2 @@ -129,28 +129,6 @@ fi blog_cache_file="${project_dir}/.blog_cache" pages_cache_file="${project_dir}/.pages_cache" -case "$1" in - add) - if [[ $# -eq 3 ]]; then - _add_site "$2" "$3" - else - echo "Usage: qsgen2 add \"Site Name\" \"/path/to/project\"" - fi - exit - ;; - list) - _list_sites - exit - ;; - 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]" - ;; -esac - function _msg() { # Use this function to write out messages based on their type # Types are: std=green - info=yellow - debug=red other=bold_yellow @@ -178,6 +156,29 @@ function _msg() { esac } +case "$1" in + add) + if [[ $# -eq 3 ]]; then + _add_site "$2" "$3" + else + echo "Usage: qsgen2 add \"Site Name\" \"/path/to/project\"" + fi + exit + ;; + list) + _list_sites + exit + ;; + force) + _msg sub "- Forced Update: Generating Everything" + : >| "$blog_cache_file" # Truncate the blog cache before doing update + : >| "$pages_cache_file" # Truncate the page cache before doing update + ;; + *) + #echo "Usage: qsgen2 [command]" + ;; +esac + # Let's check if qsgen2 can generate this site by checking if 'generator' is available if [[ ! ${generator} ]] || [[ -d $(pwd)/.git ]]; then _msg sub "${0:t} cannot parse this site. Exiting."