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>
This commit is contained in:
Greg Pfeil 2023-01-26 14:31:09 -07:00
parent 069159b8c1
commit 81cc5b98e1
No known key found for this signature in database
GPG Key ID: 1193ACD196ED61F2
1 changed files with 7 additions and 2 deletions

View File

@ -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 dont 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)