diff --git a/test_web.sh b/test_web.sh index af5a619..74289e0 100755 --- a/test_web.sh +++ b/test_web.sh @@ -39,30 +39,27 @@ else fi if [ -z "$2" ]; then - # First try symlink from parent repo's bin/whck - # Second try compiled version from parent repo (endpoint implementation) in whck submodule - # Third try compiled version from whck folder in grandparent folder (eg. when called from - # forge/endpoints.php/spec/test_web.sh to find forge/whck/target/*/whck) + # First try build script from whck/ in current folder (called from endpoints.php repo) + # Or try build script from ../whck folder (called from this submodule) output="$(findBin \ - ../bin/whck \ - ../whck/target/release/whck \ - ../whck/target/debug/whck \ - ../../whck/target/release/whck \ - ../../whck/target/debug/whck \ + whck/bin/cli \ + ../whck/bin/cli )" if [ $? -eq 0 ]; then if [[ "$(echo "$output" | wc -l)" == "1" ]]; then - export WHCK="$output" + export FIND_WHCK="$output" else # Some warnings, print but use result from last line echo "$output" | head -n -1 - export WHCK="$(echo "$output" | tail -n 1)" + export FIND_WHCK="$(echo "$output" | tail -n 1)" fi else echo "ERROR: Could not find webhook check program (whck). Output:" echo "$output" exit 1 fi + # cli script needs to be executed to get absolute path to the program + export WHCK="$("$FIND_WHCK")" else if [ -x "$ORIGDIR"/"$2" ]; then export WHCK="$(realpath "$ORIGDIR"/"$2")"