Skip to content

Commit 4ac58c1

Browse files
committed
🐚 Adds --verbose parameter
1 parent 77f24a5 commit 4ac58c1

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

jekyll-build

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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
4548
EOF
@@ -50,6 +53,7 @@ EOF
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')
@@ -109,13 +113,23 @@ fi
109113

110114

111115
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+
112126
## Use API keys if configured for repo and available to user during build process
113127
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[@]}
116130
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[@]}
119133
fi
120134

121135
[[ "${_pwd}" == "${_git_path}" ]] || cd "${_pwd}"

0 commit comments

Comments
 (0)