@@ -40,6 +40,9 @@ usage(){
40
40
# -l --license
41
41
# Shows script or project license then exits
42
42
#
43
+ # -v --verbose
44
+ # Runs build commands verbosely
45
+ #
43
46
# -h --help help
44
47
# Displays this message and exits
45
48
EOF
50
53
51
54
_args=(" ${@:?# No arguments provided try: ${__NAME__} help} " )
52
55
_valid_args=(' --help|-h|help:bool'
56
+ ' --verbose|-v|verbose:bool'
53
57
' --submodules|-s|submodules:bool'
54
58
' --license|-l|license:bool'
55
59
' --repo-name:posix-nil' )
109
113
110
114
111
115
source " ${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
+
112
126
# # Use API keys if configured for repo and available to user during build process
113
127
if 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[@]}
116
130
else
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[@]}
119
133
fi
120
134
121
135
[[ " ${_pwd} " == " ${_git_path} " ]] || cd " ${_pwd} "
0 commit comments