fix: check compose version output, not just exit code

Without the plugin, `docker compose version` can still exit 0
by falling through to `docker version`. Grep for "Compose" in
the output to reliably detect the plugin.
This commit is contained in:
Igor Loskutov
2026-02-12 18:32:16 -05:00
parent 36a8daee61
commit e57c6186f9

View File

@@ -491,8 +491,10 @@ main() {
exit 1
fi
# Ensure Docker Compose V2 plugin is available
if ! docker compose version &>/dev/null; then
# Ensure Docker Compose V2 plugin is available.
# Check output for "Compose" — without the plugin, `docker compose version`
# may still exit 0 (falling through to `docker version`).
if ! docker compose version 2>/dev/null | grep -qi compose; then
err "Docker Compose plugin not found."
err "Install Docker Desktop, OrbStack, or: brew install docker-compose"
exit 1