Converts the docker compose check to use if statement

This commit is contained in:
Trenton Holmes 2022-04-02 14:34:11 -07:00
parent 6db3fc2eea
commit 6aa9071e24

View File

@ -59,12 +59,12 @@ fi
DOCKER_COMPOSE_CMD="docker-compose" DOCKER_COMPOSE_CMD="docker-compose"
if ! command -v ${DOCKER_COMPOSE_CMD} ; then if ! command -v ${DOCKER_COMPOSE_CMD} ; then
{ if docker compose version &> /dev/null ; then
docker compose version &> /dev/null && DOCKER_COMPOSE_CMD="docker compose" DOCKER_COMPOSE_CMD="docker compose"
} || { else
echo "docker-compose executable not found. Is docker-compose installed?" echo "docker-compose executable not found. Is docker-compose installed?"
exit 1 exit 1
} fi
fi fi
# Check if user has permissions to run Docker by trying to get the status of Docker (docker status). # Check if user has permissions to run Docker by trying to get the status of Docker (docker status).