Skip to content

Commit

Permalink
Detect whether tests are running in a TTY
Browse files Browse the repository at this point in the history
  • Loading branch information
davenquinn committed Jan 4, 2024
1 parent cfbae5f commit eb1b101
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/test-docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb1b101

Please sign in to comment.