Skip to content

Commit affe2cb

Browse files
authored
Update setup.sh
Smart Docker Compose detection (handles all versions)
1 parent 700b5d9 commit affe2cb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

setup.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,16 @@ ifneq (,$(wildcard .env))
277277
export
278278
endif
279279
280-
DOCKER_COMPOSE := docker compose
280+
# Smart Docker Compose detection (handles all versions)
281+
DOCKER_COMPOSE := $(shell \
282+
if docker-compose --version >/dev/null 2>&1; then \
283+
echo "docker-compose"; \
284+
elif docker compose version >/dev/null 2>&1; then \
285+
echo "docker compose"; \
286+
else \
287+
echo "docker-compose"; \
288+
fi)
289+
281290
# Exec into always-on wpcli container (no more "Creating ..." spam)
282291
RUN_WP := $(DOCKER_COMPOSE) exec -T wpcli wp
283292
DB_EXEC := $(DOCKER_COMPOSE) exec -T db

0 commit comments

Comments
 (0)