88e72e8a5482db677a1d07722293a3a4f8f71342

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(docker-compose)!: check for old command instead of calling `docker` (#10409)

BREAKING CHANGE: the plugin now checks for the `docker-compose` command instead
of trying whether `docker compose` is a valid command. This means that if the
old command is still installed it will be used instead. To use `docker compose`,
uninstall any old copies of `docker-compose`.

Fixes #10409

Diff

 1diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh
 2index 13985fc822b24373f5a01772c11837e1128f685f..b8a4b067db7456bd52b96ef6359cd62ffcf36643 100644
 3--- a/plugins/docker-compose/docker-compose.plugin.zsh
 4+++ b/plugins/docker-compose/docker-compose.plugin.zsh
 5@@ -1,7 +1,5 @@
 6 # support Compose v2 as docker CLI plugin
 7-DOCKER_CONTEXT=default command docker compose &>/dev/null \
 8-  && dccmd='docker compose' \
 9-  || dccmd='docker-compose'
10+(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose'
11 
12 alias dco="$dccmd"
13 alias dcb="$dccmd build"