Skip to content

Commit e3f817a

Browse files
committed
build_sysext: Use strict mode
Using strict mode install a trap handler that prints backtraces in case of errors. This will be useful to print some additional debugging information.
1 parent 230020c commit e3f817a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

build_sysext

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ FLAGS "$@" || exit 1
8383

8484
eval set -- "${FLAGS_ARGV}"
8585

86+
# Only now can we die on error. shflags functions leak non-zero error codes,
87+
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
88+
switch_to_strict_mode -uo pipefail
89+
8690
# Validate command line parameters
8791

8892
SYSEXTNAME="${1:-}"
@@ -129,8 +133,6 @@ _get_sysext_arch() {
129133
fi
130134
}
131135

132-
set -euo pipefail
133-
134136
cleanup() {
135137
local dirs=(
136138
"${BUILD_DIR}/fs-root"

0 commit comments

Comments
 (0)