From 6f4c48702c846f6dfef2a2c42f2393e9747bab46 Mon Sep 17 00:00:00 2001 From: Papa Bakary Camara Date: Fri, 9 Aug 2024 10:47:36 +0200 Subject: [PATCH] Switch order of checks --- run_in_docker.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/run_in_docker.sh b/run_in_docker.sh index af819dc2..930ecf45 100755 --- a/run_in_docker.sh +++ b/run_in_docker.sh @@ -7,16 +7,17 @@ command_exists() { command -v "$1" &> /dev/null } -# Check if Podman is installed -if command_exists podman; then - CONTAINER_TOOL="podman" - COMPOSER="podman-compose" + # Check if Docker is installed -elif command_exists docker; then +if command_exists docker; then CONTAINER_TOOL="docker" COMPOSER="docker compose" +# Check if Podman is installed +elif command_exists podman; then + CONTAINER_TOOL="podman" + COMPOSER="podman-compose" else - echo "Neither Docker nor Podman is installed on this system." + echo "Neither Docker nor Podman are installed on this system." exit 1 fi @@ -165,6 +166,7 @@ POSTGRES_DB_NAME="$db_name" "$COMPOSER" $(with_profile "$1") $(with_no_mock "$3" # Step 5: Find the container ID of the insights-behavioral-spec container cid=$("$CONTAINER_TOOL" ps | grep 'insights-behavioral-spec:latest' | cut -d ' ' -f 1) +exit 0 # shellcheck disable=SC2016 REMOTE_PATH_FOR_SERVICE="$cid:$("$CONTAINER_TOOL" exec "$cid" bash -c 'echo "$HOME"')"