V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m59s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 1m59s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -13,11 +13,13 @@
|
||||
guard_sourcing || return "${ERR_GUARD_SOURCE}"
|
||||
|
||||
#######################################
|
||||
# Capture an initial snapshot of all variables (excluding '^(BASH|_).*').
|
||||
# Capture an initial snapshot of all variables (excluding '^(BASH|_|CISS_SECRET_)').
|
||||
# Globals:
|
||||
# VAR_DUMP_VARS_INITIAL
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
dump_vars_initial() {
|
||||
# shellcheck disable=SC2312
|
||||
@@ -25,12 +27,16 @@ dump_vars_initial() {
|
||||
declare var
|
||||
while IFS= read -r var; do
|
||||
declare -p "${var}" 2> /dev/null
|
||||
done < <(compgen -v | grep -Ev '^(BASH|_).*')
|
||||
done < <(compgen -v | grep -Ev '^(BASH|_|CISS_SECRET_)')
|
||||
} | sort >| "${VAR_DUMP_VARS_INITIAL}"
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f dump_vars_initial
|
||||
|
||||
#######################################
|
||||
# Capture the final snapshot of all variables (excluding '^(BASH|_).*').
|
||||
# Capture the final snapshot of all variables (excluding '^(BASH|_|CISS_SECRET_)').
|
||||
# Globals:
|
||||
# LOG_VAR
|
||||
# VAR_DUMP_VARS_FINAL
|
||||
@@ -38,6 +44,8 @@ dump_vars_initial() {
|
||||
# VAR_VERSION
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# 0: on success
|
||||
#######################################
|
||||
dump_vars_exiting() {
|
||||
set +x
|
||||
@@ -46,7 +54,7 @@ dump_vars_exiting() {
|
||||
declare var
|
||||
while IFS= read -r var; do
|
||||
declare -p "${var}" 2>/dev/null
|
||||
done < <(compgen -v | grep -Ev '^(BASH|_).*')
|
||||
done < <(compgen -v | grep -Ev '^(BASH|_|CISS_SECRET_)')
|
||||
} | sort >| "${VAR_DUMP_VARS_FINAL}"
|
||||
set -x
|
||||
|
||||
@@ -71,5 +79,10 @@ dump_vars_exiting() {
|
||||
set -x
|
||||
|
||||
rm -f "${VAR_DUMP_VARS_INITIAL}" "${VAR_DUMP_VARS_FINAL}"
|
||||
|
||||
return 0
|
||||
}
|
||||
### Prevents accidental 'unset -f'.
|
||||
# shellcheck disable=SC2034
|
||||
readonly -f dump_vars_exiting
|
||||
# vim: number et ts=2 sw=2 sts=2 ai tw=128 ft=sh
|
||||
|
||||
Reference in New Issue
Block a user