From 99824628d954e6f1e7167a6ce25cbc1540e6944e Mon Sep 17 00:00:00 2001 From: Ayal Spitz Date: Mon, 26 Jan 2026 08:45:43 -0500 Subject: [PATCH] docker: add Bash 4+ version check for macOS compatibility The script uses associative arrays (declare -A) which require Bash 4+. macOS ships with Bash 3.2 due to GPLv3 licensing, causing the script to fail with "declare: -A: invalid option". This adds a version check with a helpful error message directing macOS users to install Bash via Homebrew. Co-Authored-By: Claude Opus 4.5 --- docker-setup.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker-setup.sh b/docker-setup.sh index 776541827..f0c71162f 100755 --- a/docker-setup.sh +++ b/docker-setup.sh @@ -1,6 +1,17 @@ #!/usr/bin/env bash set -euo pipefail +if ((BASH_VERSINFO[0] < 4)); then + if [[ "$OSTYPE" == darwin* ]]; then + echo "Bash 4+ required. macOS ships with Bash 3.2." >&2 + echo "Install via: brew install bash" >&2 + echo "Then run: /opt/homebrew/bin/bash $0" >&2 + else + echo "Bash 4+ required (current: ${BASH_VERSION})" >&2 + fi + exit 1 +fi + ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" COMPOSE_FILE="$ROOT_DIR/docker-compose.yml" EXTRA_COMPOSE_FILE="$ROOT_DIR/docker-compose.extra.yml"