diff --git a/setup/functions.sh b/setup/functions.sh index 1a74edfd..fbfe62ce 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -3,7 +3,7 @@ # -u: exit if we have a variable typo. # -o pipefail: don't ignore errors in the non-last command in a pipeline set -euo pipefail - +trap 'rc=$?; echo "$0: Error on line $LINENO running $BASH_COMMAND which had the following exit code $rc" 1>&2' EXIT function hide_output { # This function hides the output of a command unless the command fails # and returns a non-zero exit code. diff --git a/setup/start.sh b/setup/start.sh index 83bee212..0b145022 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -1,7 +1,7 @@ #!/bin/bash # This is the entry point for configuring the system. ##################################################### -trap 'rc=$?; echo "$0: Error on line $LINENO running $BASH_COMMAND which had the following exit code $rc" 1>&2' ERR + source setup/functions.sh # load our functions # Check system setup: Are we running as root on Ubuntu 18.04 on a