comparison scripts/Docker/roundup_start @ 7675:b3c3e508b18f

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/
author John Rouillard <rouilj@ieee.org>
date Tue, 24 Oct 2023 21:50:39 -0400
parents b8aef93178db
children 678d235f024d
comparison
equal deleted inserted replaced
7674:b8aef93178db 7675:b3c3e508b18f
5 # for installation and initialization. 5 # for installation and initialization.
6 6
7 # "$@" should be one of the recognized keywords or arguments for 7 # "$@" should be one of the recognized keywords or arguments for
8 # roundup-server including one or more tracker tracker=directory pairs. 8 # roundup-server including one or more tracker tracker=directory pairs.
9 9
10 # exit on errors 10 # exit on errors; POSIX (e.g. dash as on ubuntu) doesn't support
11 set -eo pipefail 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
12 18
13 if ! [ -z "$SHELL_DEBUG" ]; then 19 if ! [ -z "$SHELL_DEBUG" ]; then
14 set -xv 20 set -xv
15 fi 21 fi
16 22
17 trap exit INT 23 trap exit INT
18 trap "echo 'Exiting on pipefail'" ERR
19 24
20 do_exit=0 25 do_exit=0
21 26
22 if test -t 0 -a -t 1; then # see if stdin/out are associated with a tty 27 if test -t 0 -a -t 1; then # see if stdin/out are associated with a tty
23 might_be_interactive="true" 28 might_be_interactive="true"

Roundup Issue Tracker: http://roundup-tracker.org/