diff --git a/gdrcd-stack b/gdrcd-stack index 1659897..e0e072a 100755 --- a/gdrcd-stack +++ b/gdrcd-stack @@ -51,7 +51,7 @@ _dc() { # Check if docker is installed _checkDocker() { - if ! type "docker" >/dev/null 2>&1; then + if ! command -v docker &> /dev/null; then echo "Error: Docker not found" exit 1; fi; @@ -59,15 +59,17 @@ _checkDocker() { # Check if docker compose is installed _checkDockerCompose() { - if ! type "docker-compose" >/dev/null 2>&1; then - echo "Error: this stack requires Docker Compose v2, please install it and try again" - exit 1; - fi; + # check if docker compose is installed + if ! command -v docker compose >/dev/null 2>&1; then + # check if docker-compose is installed + if ! command -v docker-compose >/dev/null 2>&1; then + echo "Error: Docker Compose not found" + exit 1; + fi; - # check if docker compose is installed - if ! type "docker compose" >/dev/null 2>&1; then - echo "Error: Docker Compose not found" + # if docker-compose is installed, suggest to install docker compose v2 + echo "Error: this stack requires Docker Compose v2, please install it and try again" exit 1; fi; }