Skip to content

Commit 64cbca7

Browse files
committed
fix
1 parent 84a8cc6 commit 64cbca7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

usr/libexec/helper-scripts/log_run_die.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ if ! command -v stecho &>/dev/null ; then
1212
}
1313
fi
1414

15+
re_enable_xtrace_maybe() {
16+
if test "${xtrace:-}" = "1"; then
17+
set -o xtrace
18+
fi
19+
}
20+
1521
## Logging mechanism with easy customization of message format as well as
1622
## standardization on how the messages are delivered.
1723
## usage: log [info|notice|warn|error] "X occurred."
@@ -60,6 +66,7 @@ log(){
6066
;;
6167
*)
6268
log bug "Unsupported log type specified: '${log_type}'"
69+
re_enable_xtrace_maybe
6370
die 1 "Please report this bug."
6471
esac
6572
## uniform log format
@@ -74,6 +81,7 @@ log(){
7481
case "${log_type}" in
7582
bug|error)
7683
stecho "${log_full}" >&2
84+
re_enable_xtrace_maybe
7785
return 0
7886
;;
7987
null)
@@ -98,9 +106,7 @@ log(){
98106

99107
#sleep 0.1
100108

101-
if test "${xtrace:-}" = "1"; then
102-
set -o xtrace
103-
fi
109+
re_enable_xtrace_maybe
104110
}
105111

106112

0 commit comments

Comments
 (0)