From e17bb469109ef247054d4180f548413f7d28ac2a Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Sat, 16 Mar 2024 01:29:58 +0100 Subject: [PATCH] gotta-patch-em: Require Bash version 4+ [why] Native MacOS has only an ancient Bash 3.x But we use arrays... and rewriting only to support 15 year old shells? [how] Check the Major Bash version number and bail out if too old. Fixes: #1505 Signed-off-by: Fini Jastrow --- bin/scripts/gotta-patch-em-all-font-patcher!.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/scripts/gotta-patch-em-all-font-patcher!.sh b/bin/scripts/gotta-patch-em-all-font-patcher!.sh index 96e466bd1..2980064e0 100755 --- a/bin/scripts/gotta-patch-em-all-font-patcher!.sh +++ b/bin/scripts/gotta-patch-em-all-font-patcher!.sh @@ -10,6 +10,13 @@ LINE_PREFIX="# [Nerd Fonts] " +test "${BASH_VERSION%%[^0-9]*}" -ge 4 || { + echo >&2 "$LINE_PREFIX A non-ancient version of Bash is needed (>= 4)" + echo >&2 "# Bash version 4 has been released in 2009, so it's about time to update" + echo >&2 "# (Most likely you are on MacOS; try Homebrew with \`brew install bash\`) ;-)" + exit 1 +} + # Check for Fontforge type fontforge >/dev/null 2>&1 || { echo >&2 "$LINE_PREFIX FontForge must be installed before running this script."