diff --git a/test/bin/test b/test/bin/test index a6d2357e2..9c3e6fdd8 100755 --- a/test/bin/test +++ b/test/bin/test @@ -105,7 +105,7 @@ configureWithArguments () { # Commands # - DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`" + DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec `echoDockerComposeExecuteTtyFlags` -u `id -u`:`id -g`" INSTALL_GIT_SUB_MODULE='git submodule update --checkout --recursive --force' COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader' @@ -125,6 +125,28 @@ configureWithArguments () else :; fi } +echoDockerComposeExecuteTtyFlags () +{ + if hasTty; then + : + else + echo '-T' + fi +} + +hasTty () +{ + test -t 0 || { + return 1 + } + + test -t 1 || { + return 1 + } + + return 0 +} + populatePHPVersions () { if test x'all' = x"${PHP_VERSIONS}"; then