From 564da317a0b2ede271a1309264cc0009df8b7ea9 Mon Sep 17 00:00:00 2001 From: Jakob Voss Date: Wed, 29 May 2024 11:04:29 +0200 Subject: [PATCH] Don't silently proceed on errors Closes #243 --- common-script | 2 +- qa-catalogue | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common-script b/common-script index 244a8af0..2fd8a9ab 100755 --- a/common-script +++ b/common-script @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -uo pipefail +set -ueo pipefail # when run interactively via terminal if [ -t 1 ]; then diff --git a/qa-catalogue b/qa-catalogue index 4b1353e4..a6b92155 100755 --- a/qa-catalogue +++ b/qa-catalogue @@ -1,5 +1,6 @@ #!/bin/bash set -ueo pipefail +set -o allexport usage() { cat << EOF @@ -62,7 +63,7 @@ if [[ -f "$ENV_FILE" ]]; then source "$ENV_FILE" fi -# default values, if not set +# default values BASE_INPUT_DIR=${BASE_INPUT_DIR:-./input} BASE_OUTPUT_DIR=${BASE_OUTPUT_DIR:-./output} MASK=${MASK:-*} @@ -105,8 +106,15 @@ if [[ ! -z "$WEB_CONFIG" ]]; then fi fi +fail() { + echo >&2 "" + echo >&2 "AN ERROR OCCURRED" + echo >&2 "Please consult log files in $BASE_INPUT_DIR/_reports/$NAME" + exit 1 +} + # run actual analysis -. ./common-script ${1:-} +./common-script ${1:-} || fail # optionally update web configuration if [[ ! -z "$WEB_CONFIG" ]]; then