Commit d32649e0 authored by John A's avatar John A

Add bash >= v4.0 check

parent b3bef593
......@@ -42,6 +42,12 @@ nfetch=0
changed=()
seed="$RANDOM"
# ensure Bash version >= 4.0
ver="$(printf '%s' "$BASH_VERSION" | cut -d . -f 1)"
if [ -z "$ver" ] || [ "$ver" -lt 4 ]; then
printf '%s\n' "Error: requires Bash v4.0 or higher. You have version $BASH_VERSION."
fi
# ensure MacOS compatibility with GNU getopt
if [[ "$OSTYPE" == 'darwin'* ]]; then
GGETOPT=/usr/local/Cellar/gnu-getopt/*/bin/getopt # should find gnu-getopt
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment