|
|
|
|
80
|
# In such cases, it makes sense to print also version information to
|
80
|
# In such cases, it makes sense to print also version information to
|
81
|
# help users with reporting.
|
81
|
# help users with reporting.
|
82
|
#
|
82
|
#
|
83
|
- local msg
|
|
|
|
|
83
|
+ local msg # message core
|
84
|
for msg in "$@";
|
84
|
for msg in "$@";
|
85
|
do
|
85
|
do
|
86
|
warn "bug: $msg"
|
86
|
warn "bug: $msg"
|
|
|
|
|
212
|
# This is aimed to help debugging and testing the app (or Saturnin
|
212
|
# This is aimed to help debugging and testing the app (or Saturnin
|
213
|
# itself) by showing packaging and deployment related info.
|
213
|
# itself) by showing packaging and deployment related info.
|
214
|
#
|
214
|
#
|
215
|
- local key=${1#--saturnin-get-}
|
|
|
|
|
215
|
+ local key=${1#--saturnin-get-} # internal info key
|
216
|
case "$key" in
|
216
|
case "$key" in
|
217
|
saturnin-conf-path) echo "$SATURNIN_CONF_PATH" ;;
|
217
|
saturnin-conf-path) echo "$SATURNIN_CONF_PATH" ;;
|
218
|
app-git-hash) echo "$SATURNIN_APP_GIT_HASH" ;;
|
218
|
app-git-hash) echo "$SATURNIN_APP_GIT_HASH" ;;
|
|
|
|
|
246
|
# After setting all mandatory environment variables, call this from your
|
246
|
# After setting all mandatory environment variables, call this from your
|
247
|
# main meta-command script.
|
247
|
# main meta-command script.
|
248
|
#
|
248
|
#
|
249
|
- local subcommand
|
|
|
|
|
249
|
+ local subcommand # subcommand to execute (first non-option)
|
250
|
test -n "$SATURNIN_CACHE_HOME" || die "SATURNIN_CACHE_HOME is not set"
|
250
|
test -n "$SATURNIN_CACHE_HOME" || die "SATURNIN_CACHE_HOME is not set"
|
251
|
test -n "$SATURNIN_LIBEXEC" || die "SATURNIN_LIBEXEC is not set"
|
251
|
test -n "$SATURNIN_LIBEXEC" || die "SATURNIN_LIBEXEC is not set"
|
252
|
test -n "$SATURNIN_LIBEXEC_PREFIX" || die "SATURNIN_LIBEXEC_PREFIX is not set"
|
252
|
test -n "$SATURNIN_LIBEXEC_PREFIX" || die "SATURNIN_LIBEXEC_PREFIX is not set"
|
|
|
|
|
310
|
# unless syntax check fails, execute it as Bash code (in separate
|
310
|
# unless syntax check fails, execute it as Bash code (in separate
|
311
|
# process).
|
311
|
# process).
|
312
|
#
|
312
|
#
|
313
|
- local hname="$1"
|
|
|
314
|
- local hook_code
|
|
|
|
|
313
|
+ local hname="$1" # hook name
|
|
|
314
|
+ local hook_code # ... code
|
315
|
test -n "$SATURNIN_SUBCOMMAND" || {
|
315
|
test -n "$SATURNIN_SUBCOMMAND" || {
|
316
|
warn "unknown subcommand, ignoring hook: $hname"
|
316
|
warn "unknown subcommand, ignoring hook: $hname"
|
317
|
return 0
|
317
|
return 0
|
|
|
|
|
377
|
# status of the payload command, even if hooks fail. Ignore post-hook
|
377
|
# status of the payload command, even if hooks fail. Ignore post-hook
|
378
|
# if payload command failed.
|
378
|
# if payload command failed.
|
379
|
#
|
379
|
#
|
380
|
- local es=0
|
|
|
|
|
380
|
+ local es=0 # exit status of thid function
|
381
|
saturnin__runhook pre
|
381
|
saturnin__runhook pre
|
382
|
"$@" || return $?
|
382
|
"$@" || return $?
|
383
|
es=$?
|
383
|
es=$?
|
|
|
|
|
486
|
# drop them and also get the colons right.
|
486
|
# drop them and also get the colons right.
|
487
|
#
|
487
|
#
|
488
|
local idx=0 # current item index (zero-based)
|
488
|
local idx=0 # current item index (zero-based)
|
489
|
- local path
|
|
|
|
|
489
|
+ local path # each path on stdin
|
490
|
while read -r path;
|
490
|
while read -r path;
|
491
|
do
|
491
|
do
|
492
|
test -z "$path" && continue
|
492
|
test -z "$path" && continue
|