This commit is contained in:
CanbiZ
2025-09-16 10:41:55 +02:00
parent 67ebb3782c
commit ba51df5bb1
2 changed files with 9 additions and 5 deletions

View File

@@ -193,13 +193,17 @@ SILENT_LOGFILE="/tmp/silent.$$.log"
silent() {
local cmd="$*"
set +Eeuo pipefail
trap - ERR
"$@" >>"$SILENT_LOGFILE" 2>&1
local rc=$?
set -Eeuo pipefail
trap 'error_handler' ERR
if [[ $rc -ne 0 ]]; then
error_handler "$rc" "$cmd"
BASH_COMMAND="$cmd"
error_handler "$rc"
fi
return $rc
}