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 Apr 8, 2024
1 parent c6907e5 commit 6959559
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6959559

Please sign in to comment.