Skip to content

Commit 715ebcb

Browse files
committed
fix(test): execution without terminal
Error: the input device is not a TTY
1 parent 0e9e01a commit 715ebcb

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

test/bin/test

+27-1
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,11 @@ startDockerComposeServices ()
103103

104104
configureWithArguments ()
105105
{
106+
configureDockerComposeExecFlags
107+
106108
# Commands
107109
#
108-
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`"
110+
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec ${dockerComposeExecFlags}"
109111
INSTALL_GIT_SUB_MODULE='git submodule update --checkout --recursive --force'
110112
COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader'
111113

@@ -125,6 +127,30 @@ configureWithArguments ()
125127
else :; fi
126128
}
127129

130+
configureDockerComposeExecFlags ()
131+
{
132+
dockerComposeExecFlags="-u `id -u`:`id -g`"
133+
134+
if hasTty; then
135+
:
136+
else
137+
dockerComposeExecFlags="${dockerComposeExecFlags} -T"
138+
fi
139+
}
140+
141+
hasTty ()
142+
{
143+
test -t 0 || {
144+
return 1
145+
}
146+
147+
test -t 1 || {
148+
return 1
149+
}
150+
151+
return 0
152+
}
153+
128154
populatePHPVersions ()
129155
{
130156
if test x'all' = x"${PHP_VERSIONS}"; then

0 commit comments

Comments
 (0)