From 47ee90cd544e78ccd420ccf135ca7d2cbcc670cb Mon Sep 17 00:00:00 2001 From: southerntofu Date: Tue, 22 Feb 2022 19:14:25 +0100 Subject: [PATCH] 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 --- bin/cli | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cli b/bin/cli index 36e3c5b..d40ce8b 100755 --- a/bin/cli +++ b/bin/cli @@ -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"