Skip to content

Commit fb5c1a2

Browse files
committed
update.sh: Increase error verbosity
Signed-off-by: Daniel Rudolf <[email protected]>
1 parent 0006406 commit fb5c1a2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

update.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/bin/bash
2-
set -e
2+
set -eu -o pipefail -x
33

44
# Check for dependencies
55
command -v curl >/dev/null 2>&1 || { echo >&2 "'curl' is required but not found. Aborting."; exit 1; }
66
command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Aborting."; exit 1; }
7-
if [ -z "${BASH_VERSINFO}" ] || [ -z "${BASH_VERSINFO[0]}" ] || [ ${BASH_VERSINFO[0]} -lt 4 ]; then
8-
echo "BASH version 4.0 or greater is required. Aborting."
9-
exit 1
10-
fi
7+
[ -n "${BASH_VERSINFO}" ] && [ -n "${BASH_VERSINFO[0]}" ] && [ ${BASH_VERSINFO[0]} -ge 4 ] \
8+
|| { echo >&2 "Bash 4.0 or greater is required. Aborting."; exit 1; }
119

1210
declare -A cmd=(
1311
[apache]='apache2-foreground'

0 commit comments

Comments
 (0)