Browse Source

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
Marc Cornellà 2 years ago
parent
commit
88e72e8a54
1 changed files with 1 additions and 3 deletions
  1. 1 3
      plugins/docker-compose/docker-compose.plugin.zsh

+ 1 - 3
plugins/docker-compose/docker-compose.plugin.zsh

@@ -1,7 +1,5 @@
 # support Compose v2 as docker CLI plugin
-DOCKER_CONTEXT=default command docker compose &>/dev/null \
-  && dccmd='docker compose' \
-  || dccmd='docker-compose'
+(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose'
 
 alias dco="$dccmd"
 alias dcb="$dccmd build"