From edc844e7d3f42b6065338c2b56b697492202267e Mon Sep 17 00:00:00 2001 From: Christopher Cooper Date: Sat, 30 Apr 2022 20:01:40 -0700 Subject: [PATCH] allow run-tests.sh to be called from other directories Also, just use tee non-appending mode instead of deleting the file. --- database-seeds/scripts/run-tests.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/database-seeds/scripts/run-tests.sh b/database-seeds/scripts/run-tests.sh index 60d6e767a..0b843a99d 100755 --- a/database-seeds/scripts/run-tests.sh +++ b/database-seeds/scripts/run-tests.sh @@ -1,13 +1,9 @@ #!/bin/bash +cd "$(dirname "$0")" + # Output stderr and stdout to the terminal, but only save stderr to a file # Isn't bash wonderful? -# I can't figure out how to make it write to failed-tests.log instead of appending -# so, whatever. -# look. I don't like bash much. -# I'd rather spend 0% of my time here. -rm failed-tests.log -f - -ts-node test/collections.test.ts 2> >(tee -a failed-tests.log >&2) -ts-node test/id.test.ts 2> >(tee -a failed-tests.log >&2) \ No newline at end of file +ts-node test/collections.test.ts 2> >(tee failed-tests.log >&2) +ts-node test/id.test.ts 2> >(tee -a failed-tests.log >&2)