qsgen2: Add message when running in force mode
This commit is contained in:
parent
7b6d1935f5
commit
b5dd211ed5
45
qsgen2
45
qsgen2
@ -129,28 +129,6 @@ fi
|
|||||||
blog_cache_file="${project_dir}/.blog_cache"
|
blog_cache_file="${project_dir}/.blog_cache"
|
||||||
pages_cache_file="${project_dir}/.pages_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() {
|
function _msg() {
|
||||||
# Use this function to write out messages based on their type
|
# Use this function to write out messages based on their type
|
||||||
# Types are: std=green - info=yellow - debug=red other=bold_yellow
|
# Types are: std=green - info=yellow - debug=red other=bold_yellow
|
||||||
@ -178,6 +156,29 @@ function _msg() {
|
|||||||
esac
|
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
|
# Let's check if qsgen2 can generate this site by checking if 'generator' is available
|
||||||
if [[ ! ${generator} ]] || [[ -d $(pwd)/.git ]]; then
|
if [[ ! ${generator} ]] || [[ -d $(pwd)/.git ]]; then
|
||||||
_msg sub "${0:t} cannot parse this site. Exiting."
|
_msg sub "${0:t} cannot parse this site. Exiting."
|
||||||
|
Loading…
Reference in New Issue
Block a user