mirror of
https://github.com/levogevo/ffmpeg-builder.git
synced 2026-03-16 19:20:11 +00:00
preserve trace status between echo_if_fail
This commit is contained in:
@@ -43,6 +43,17 @@ echo_if_fail() {
|
||||
local out="${TMP_DIR}/${logName}stdout"
|
||||
local err="${TMP_DIR}/${logName}stderr"
|
||||
|
||||
# get current trace status
|
||||
local set
|
||||
if [[ $- == *x* ]]; then
|
||||
set='-x'
|
||||
else
|
||||
set='+x'
|
||||
fi
|
||||
|
||||
# stop tracing before new trace file
|
||||
set +x
|
||||
|
||||
# set trace to the cmdEvalTrace and open file descriptor
|
||||
local cmdEvalTrace="${TMP_DIR}/${logName}cmdEvalTrace"
|
||||
exec 5>"${cmdEvalTrace}"
|
||||
@@ -56,6 +67,9 @@ echo_if_fail() {
|
||||
set +x
|
||||
exec 5>&-
|
||||
|
||||
# reset previous state
|
||||
set ${set}
|
||||
|
||||
# parse out relevant part of the trace
|
||||
local cmdEvalLines=()
|
||||
while IFS= read -r line; do
|
||||
|
||||
Reference in New Issue
Block a user