Skip to content

Commit bc22903

Browse files
committed
Prefer docker compose over docker-compose
Fixes #144
1 parent e4c95c4 commit bc22903

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

test.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,15 @@ if ! [ -x "${docker_cmd}" ]; then
121121
exit ${no_dep_exit_code}
122122
fi
123123

124-
docker_compose_cmd="$(command -v docker-compose)"
125-
if ! [ -x "${docker_compose_cmd}" ]; then
124+
if docker compose > /dev/null; then
125+
docker_compose_cmd="docker compose"
126+
elif command -v docker-compose > /dev/null; then
127+
docker_compose_cmd="docker-compose"
128+
else
126129
e "required dependency not found: docker-compose not found in the path or not executable"
127130
exit ${no_dep_exit_code}
128131
fi
132+
e "Using Docker Compose command: ${docker_compose_cmd}"
129133

130134
curl_cmd="$(command -v curl)"
131135
if ! [ -x "${curl_cmd}" ]; then
@@ -161,7 +165,7 @@ compose() {
161165
export NGINX_INTERNAL_PORT=80
162166
fi
163167

164-
"${docker_compose_cmd}" -f "${test_compose_config}" -p "${test_compose_project}" "$@"
168+
${docker_compose_cmd} -f "${test_compose_config}" -p "${test_compose_project}" "$@"
165169
}
166170

167171
integration_test() {

0 commit comments

Comments
 (0)