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."