From 9025ef5eef69466644dec3f1ac9fca4f1a311a06 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Mon, 21 Feb 2022 00:38:17 +0100 Subject: [PATCH] Don't error for stuff that should be allowed to fail (checking missing path) --- test_cli.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test_cli.sh b/test_cli.sh index 0003da0..962d474 100755 --- a/test_cli.sh +++ b/test_cli.sh @@ -29,13 +29,18 @@ if [ -z "$1" ]; then # cli script needs to be executed to get absolute path to the program export WHCK="$("$FIND_WHCK")" else - if WHCK="$(realpath -q "$ORIGDIR"/"$1")"; then - export WHCK + if [ -x "$ORIGDIR"/"$1" ]; then + export WHCK="$(realpath "$ORIGDIR"/"$1")" + elif [ -x "$1" ]; then + export WHCK="$(realpath "$ORIGDIR"/"$1")" else - export WHCK="$(realpath "$1")" + echo "ERROR: Could not find provided validation program: "$1"" + exit 2 fi fi bats tests/cli/*.bats +status=$? cd "$ORIGDIR" +exit $status