Skip to content

Commit

Permalink
fix(test): execution without terminal
Browse files Browse the repository at this point in the history
Error: the input device is not a TTY
  • Loading branch information
alquerci committed Mar 4, 2024
1 parent c6709a1 commit 448b5f2
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion test/bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ startDockerComposeServices ()

configureWithArguments ()
{
configureDockerComposeExecFlags

# Commands
#
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`"
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec ${dockerComposeExecFlags}"
INSTALL_GIT_SUB_MODULE='git submodule update --checkout --recursive --force'
COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader'

Expand All @@ -125,6 +127,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
Expand Down

0 comments on commit 448b5f2

Please sign in to comment.