Skip to content

Commit e451fe6

Browse files
committed
fix(test): execution without terminal
Error: the input device is not a TTY
1 parent 5b7958b commit e451fe6

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/bin/test

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ startDockerComposeServices ()
9191

9292
configureWithArguments ()
9393
{
94+
configureDockerComposeExecFlags
95+
9496
# Commands
9597
#
96-
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec -u `id -u`:`id -g`"
98+
DOCKER_COMPOSE_EXEC="${DOCKER_COMPOSE} exec ${dockerComposeExecFlags}"
9799
COMPOSER_UPDATE='composer update --prefer-dist --no-suggest --optimize-autoloader'
98100

99101
# Default Options
@@ -112,6 +114,30 @@ configureWithArguments ()
112114
else :; fi
113115
}
114116

117+
configureDockerComposeExecFlags ()
118+
{
119+
dockerComposeExecFlags="-u `id -u`:`id -g`"
120+
121+
if hasTty; then
122+
:
123+
else
124+
dockerComposeExecFlags="${dockerComposeExecFlags} -T"
125+
fi
126+
}
127+
128+
hasTty ()
129+
{
130+
test -t 0 || {
131+
return 1
132+
}
133+
134+
test -t 1 || {
135+
return 1
136+
}
137+
138+
return 0
139+
}
140+
115141
populatePHPVersions ()
116142
{
117143
if test x'all' = x"${PHP_VERSIONS}"; then

0 commit comments

Comments
 (0)