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"