Skip to content

Commit e737d1e

Browse files
committed
fix: move POSIX unsupported items outside of set -e
If the non-poisx fail under a POSIX shell, allow the script to still run but with the errors. So all non-POSIX supported stuff goes before set -e. Courtesy of https://www.shellcheck.net/
1 parent 917310b commit e737d1e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/Docker/roundup_start

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@
77
# "$@" should be one of the recognized keywords or arguments for
88
# roundup-server including one or more tracker tracker=directory pairs.
99

10-
# exit on errors
11-
set -eo pipefail
10+
# exit on errors; POSIX (e.g. dash as on ubuntu) doesn't support
11+
# pipefail. So setting it will fail. Allow that to happen then
12+
# set exit on error so the script will still run.
13+
set -o pipefail
14+
# not supported by POSIX shell, but then neither is pipefail.
15+
trap "echo 'Exiting on pipefail'" ERR
16+
17+
set -e
1218

1319
if ! [ -z "$SHELL_DEBUG" ]; then
1420
set -xv
1521
fi
1622

1723
trap exit INT
18-
trap "echo 'Exiting on pipefail'" ERR
1924

2025
do_exit=0
2126

0 commit comments

Comments
 (0)