From eb1b101bd4169323d8b634b2fedd0f5470723ae2 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Thu, 4 Jan 2024 05:22:14 -0500 Subject: [PATCH] Detect whether tests are running in a TTY --- bin/test-docker | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/test-docker b/bin/test-docker index 49441ff..e5eed35 100755 --- a/bin/test-docker +++ b/bin/test-docker @@ -3,6 +3,12 @@ set -e +# Check if we're in a TTY +TTY_FLAG="" +if [ -t 1 ]; then + TTY_FLAG="-it" +fi + # Load dotenv if it exists if [ -f .env ]; then set -o allexport @@ -44,7 +50,7 @@ docker run --rm \ EOF # Run the tests -docker run -it --rm --link corelle-db:database corelle /code/bin/run-tests $@ +docker run $TTY_FLAG --rm --link corelle-db:database corelle /code/bin/run-tests $@ # Stop the database docker stop corelle-db