Skip to content

Commit

Permalink
Don't silently proceed on errors
Browse files Browse the repository at this point in the history
Closes #243
  • Loading branch information
nichtich committed May 29, 2024
1 parent 4a0fd6c commit 564da31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common-script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -uo pipefail
set -ueo pipefail

# when run interactively via terminal
if [ -t 1 ]; then
Expand Down
12 changes: 10 additions & 2 deletions qa-catalogue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
set -ueo pipefail
set -o allexport

usage() {
cat << EOF
Expand Down Expand Up @@ -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:-*}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 564da31

Please sign in to comment.