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 Jan 23, 2024
1 parent 877f710 commit 19ef236
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 --working-dir=/app --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 19ef236

Please sign in to comment.