From 0a299dc780357f34e1b0210e93b4ff7f6efac956 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Tue, 27 Jul 2021 19:15:35 +0300 Subject: [PATCH] run-docker.sh: don't rely on GITHUB_EVENT_PATH when checking for tty --- scripts/run-docker.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/run-docker.sh b/scripts/run-docker.sh index 19460171c..92098383d 100755 --- a/scripts/run-docker.sh +++ b/scripts/run-docker.sh @@ -23,11 +23,11 @@ fi echo "Running container '$CONTAINER_NAME' from image '$TERMUX_BUILDER_IMAGE_NAME'..." -if [ "${GITHUB_EVENT_PATH-x}" != "x" ]; then - # On CI/CD tty may not be available. - DOCKER_TTY="" -else +# Check whether attached to tty and adjust docker flags accordingly. +if [ -t 1 ]; then DOCKER_TTY=" --tty" +else + DOCKER_TTY="" fi $SUDO docker start $CONTAINER_NAME >/dev/null 2>&1 || {