Skip to content

Commit

Permalink
Make test script fail when any command fails
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurz committed Apr 29, 2024
1 parent 35e1e8a commit 95a1737
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env bash

# -e Exit script immediately if any command returns a non-zero exit status.
# -u Exit script immediately if an undefined variable is used.
# -o pipefail Ensure Bash pipelines return a non-zero status if any of the commands fail,
# rather than returning the exit status of the last command in the pipeline.
set -euo pipefail

if [ -z "$MATRIX_SCALA" ]; then
echo "Error: the environment variable MATRIX_SCALA is not set"
exit 1
Expand Down

0 comments on commit 95a1737

Please sign in to comment.