Don't error for stuff that should be allowed to fail (checking missing path)

This commit is contained in:
southerntofu 2022-02-21 00:38:17 +01:00
parent eab07ba4d8
commit 9025ef5eef
1 changed files with 8 additions and 3 deletions

View File

@ -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