fix: error out if commands using compose are executed

Refs #5335
This commit is contained in:
Jose Diaz-Gonzalez
2022-09-07 10:53:49 -04:00
parent 9bd927a598
commit 3ff5e0e3a6
3 changed files with 36 additions and 0 deletions

View File

@@ -399,6 +399,18 @@ get_docker_version() {
echo "$CLIENT_VERSION_STRING"
}
fn-is-compose-installed() {
declare desc="check if the compose docker plugin is installed"
local COMPOSE_INSTALLED
COMPOSE_INSTALLED="$(docker info -f '{{range .ClientInfo.Plugins}}{{if eq .Name "compose"}}true{{end}}')"
if [[ "$COMPOSE_INSTALLED" == "true" ]]; then
return 0
fi
return 1
}
is_number() {
declare desc="returns 0 if input is a number"
local NUMBER=$1