From a5acefcc9e598622b5b741540a9e62f7d8011635 Mon Sep 17 00:00:00 2001 From: wucm667 Date: Thu, 14 May 2026 11:35:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(install):=20=E6=A3=80=E6=9F=A5=20Bash=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=B9=B6=E6=8F=90=E7=A4=BA=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deploy/install.sh b/deploy/install.sh index 6dcf4123..1846dede 100644 --- a/deploy/install.sh +++ b/deploy/install.sh @@ -7,6 +7,21 @@ set -e +# Bash 4+ is required for associative arrays used by the localized message table. +# Keep this guard before any Bash 4-only syntax so older shells fail with a clear hint. +if [ -z "${BASH_VERSION:-}" ]; then + echo "Error: This installer must be run with Bash 4.0 or later." >&2 + echo "Please install Bash 4+ and run it with that interpreter." >&2 + exit 1 +fi + +BASH_MAJOR_VERSION="${BASH_VERSION%%.*}" +if [ "$BASH_MAJOR_VERSION" -lt 4 ]; then + echo "Error: Bash 4.0 or later is required. Current version: $BASH_VERSION" >&2 + echo "Please install Bash 4+ and retry with that interpreter." >&2 + exit 1 +fi + # Colors RED='\033[0;31m' GREEN='\033[0;32m'