Skip to content

Commit d06d614

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

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

test/bin/test

+23-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ configureWithArguments ()
105105
{
106106
# Commands
107107
#
108-
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`"
108+
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec `echoDockerComposeExecuteTtyFlags` -u `id -u`:`id -g`"
109109
INSTALL_GIT_SUB_MODULE='git submodule update --checkout --recursive --force'
110110
COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader'
111111

@@ -125,6 +125,28 @@ configureWithArguments ()
125125
else :; fi
126126
}
127127

128+
echoDockerComposeExecuteTtyFlags ()
129+
{
130+
if hasTty; then
131+
:
132+
else
133+
echo '-T'
134+
fi
135+
}
136+
137+
hasTty ()
138+
{
139+
test -t 0 || {
140+
return 1
141+
}
142+
143+
test -t 1 || {
144+
return 1
145+
}
146+
147+
return 0
148+
}
149+
128150
populatePHPVersions ()
129151
{
130152
if test x'all' = x"${PHP_VERSIONS}"; then

0 commit comments

Comments
 (0)