From 81cc5b98e1df9c3520d2692cda4c87a959d29956 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Thu, 26 Jan 2023 14:31:09 -0700 Subject: [PATCH] Support Bash 3.2 in fetch-params.sh MacOS still ships with a 15-year-old version of Bash so this removes some usage of features that require newer (only 10 years old) versions. Fixes #6367. Co-authored-by: Mohamed AlFalasi <2569171+edubai@users.noreply.github.com> --- zcutil/fetch-params.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zcutil/fetch-params.sh b/zcutil/fetch-params.sh index 366964e7d..b4ef2c063 100755 --- a/zcutil/fetch-params.sh +++ b/zcutil/fetch-params.sh @@ -5,10 +5,15 @@ set -eu SCRIPT_NAME=$(basename $0) -[[ -v XDG_CACHE_HOME ]] || XDG_CACHE_HOME="${HOME}/.cache" +if [[ -z "${XDG_CACHE_HOME:+x}" ]]; then + XDG_CACHE_HOME="${HOME}/.cache" +fi + # We don’t care too much about most of the properties of `XDG_RUNTIME_DIR` in # this script, so we just fall back to `XDG_CACHE_HOME`. -[[ -v XDG_RUNTIME_DIR ]] || XDG_RUNTIME_DIR="${XDG_CACHE_HOME}" +if [[ -z "${XDG_RUNTIME_DIR:+x}" ]]; then + XDG_RUNTIME_DIR="${XDG_CACHE_HOME}"; +fi uname_S=$(uname -s 2>/dev/null || echo not)