bin/cli can be called from an endpoint's spec folder

For example, if you git clone --recursive https://tildegit.org/forge/endpoints.php
you can cd endpoints.php/spec && ./test_tests_web.sh and it will work
This commit is contained in:
southerntofu 2022-02-22 19:14:25 +01:00
parent fd0ac6a610
commit 47ee90cd54
1 changed files with 6 additions and 1 deletions

View File

@ -1,9 +1,12 @@
#! /usr/bin/env bash
ORIGDIR="$(pwd)"
SCRIPTDIR="$(dirname "$0")"
BASEDIR="$(realpath "$SCRIPTDIR"/..)"
if [ -f "$BASEDIR"/target/release/whck ]; then
cd "$BASEDIR"
if [ -f target/release/whck ]; then
output="$(cargo build --release 2>&1)"
if [ $? -eq 0 ]; then
# Build succeeded echo path to binary
@ -21,3 +24,5 @@ else
exit 1
fi
fi
cd "$ORIGDIR"