From e0db4dfa39080e2ac8e98b0aa17c6287e99659af Mon Sep 17 00:00:00 2001 From: Denys Fedoryshchenko Date: Thu, 12 Dec 2024 09:51:37 +0200 Subject: [PATCH] fix(setup_admin_user): Script should be flexible on docker-compose Newer version of docker-compose is called as "docker compose", so try automatically to use it, if docker-compose is missing. Signed-off-by: Denys Fedoryshchenko --- scripts/setup_admin_user | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/setup_admin_user b/scripts/setup_admin_user index 160101ba..c3038df8 100755 --- a/scripts/setup_admin_user +++ b/scripts/setup_admin_user @@ -1,7 +1,15 @@ #!/bin/bash +# is docker-compose exists? if not use docker compose +if [ -z "$(which docker-compose)" ]; then + echo "docker-compose is not installed, using docker compose" + DOCKER_COMPOSE="docker compose" +else + DOCKER_COMPOSE="docker-compose" +fi + set -e -docker-compose run api python3 -m api.admin $* +${DOCKER_COMPOSE} run api python3 -m api.admin $* exit 0