@@ -40,6 +40,9 @@ usage(){
4040# -l --license
4141# Shows script or project license then exits
4242#
43+ # -v --verbose
44+ # Runs build commands verbosely
45+ #
4346# -h --help help
4447# Displays this message and exits
4548EOF
5053
5154_args=(" ${@:?# No arguments provided try: ${__NAME__} help} " )
5255_valid_args=(' --help|-h|help:bool'
56+ ' --verbose|-v|verbose:bool'
5357 ' --submodules|-s|submodules:bool'
5458 ' --license|-l|license:bool'
5559 ' --repo-name:posix-nil' )
109113
110114
111115source " ${HOME} /.bash_aliases"
116+
117+ _build_args=(
118+ ' --destination' " ${_srv_path} "
119+ ' --config' " ${_config_files} "
120+ )
121+
122+ (( "${# _verbose} ")) && {
123+ _build_args+=(' --verbose' )
124+ }
125+
112126# # Use API keys if configured for repo and available to user during build process
113127if grep -q -- ' jekyll-github-metadata' " ${_git_path} /Gemfile" && [ -f " ${_github_api_token_path} " ]; then
114- printf ' # JEKYLL_GITHUB_TOKEN="$(<github-api-token-path)" bundle exec jekyll build --destination %s --config %s \n' " ${_srv_path} " " ${_config_files }"
115- JEKYLL_GITHUB_TOKEN=" $( < " ${_github_api_token_path} " ) " bundle exec jekyll build --destination " ${_srv_path} " --config " ${_config_files} "
128+ printf ' # JEKYLL_GITHUB_TOKEN="$(<github-api-token-path)" bundle exec jekyll build %s \n' " ${_build_args[*] } "
129+ JEKYLL_GITHUB_TOKEN=" $( < " ${_github_api_token_path} " ) " bundle exec jekyll build ${_build_args[@]}
116130else
117- printf ' # bundle exec jekyll build --destination " %s" --config "%s" \n' " ${_srv_path} " " ${_config_files }"
118- bundle exec jekyll build --destination " ${_srv_path} " --config " ${_config_files} "
131+ printf ' # bundle exec jekyll build %s"\n' " ${_build_args[*] } "
132+ bundle exec jekyll build ${_build_args[@]}
119133fi
120134
121135[[ " ${_pwd} " == " ${_git_path} " ]] || cd " ${_pwd} "
0 commit comments