From c9e3fa0cf8f026fb85abdfa26942402ac8f70026 Mon Sep 17 00:00:00 2001 From: Waldo Jaquith Date: Tue, 18 Jun 2019 21:40:33 -0400 Subject: [PATCH] Handle directory context for test runner Toward #114. --- deploy/tests/run-all.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deploy/tests/run-all.sh b/deploy/tests/run-all.sh index 272dd5f5..206d5a85 100755 --- a/deploy/tests/run-all.sh +++ b/deploy/tests/run-all.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Switch to the working directory from wherever this is being invoked +pushd . +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd "$DIR" || exit # Run the front-end tests if ! ./front-end.sh; then @@ -16,3 +20,6 @@ if [ "$ERRORED" == true ]; then echo "Some tests failed" exit 1 fi + +# Switch back to the directory this was invoked from +popd || exit