diff --git a/tests/bin/test b/tests/bin/test index 435c35202..2a5383e27 100755 --- a/tests/bin/test +++ b/tests/bin/test @@ -91,9 +91,11 @@ startDockerComposeServices () configureWithArguments () { + configureDockerComposeExecFlags + # Commands # - DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`" + DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec ${dockerComposeExecFlags}" COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader' # Default Options @@ -112,6 +114,30 @@ configureWithArguments () else :; fi } +configureDockerComposeExecFlags () +{ + dockerComposeExecFlags="-u `id -u`:`id -g`" + + if hasTty; then + : + else + dockerComposeExecFlags="${dockerComposeExecFlags} -T" + fi +} + +hasTty () +{ + test -t 0 || { + return 1 + } + + test -t 1 || { + return 1 + } + + return 0 +} + populatePHPVersions () { if test x'all' = x"${PHP_VERSIONS}"; then