diff options
| author | Paul Buetow <paul@buetow.org> | 2022-07-30 11:34:24 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2022-07-30 11:34:24 +0100 |
| commit | 4b1875a6d7e8c682e6ae6ebe46a81cf614db5b29 (patch) | |
| tree | 4949d74f5656e7dc02e79a3a6d77c13950b388cd | |
| parent | a634d6957a0a209d0b4dd7b54f665e15663b86ac (diff) | |
also check for the correct version of bash installed
| -rwxr-xr-x | gemtexter | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -50,7 +50,16 @@ HELPHERE } # Make sure that there are the correct versions of the dependencies installed. -ensure_gnu () { +check_dependencies () { + # At least, Bash 5 is required + local -i required_version=5 + IFS=. read -ra version <<< "$BASH_VERSION" + if [ "${version[0]}" -lt $required_version ]; then + log ERROR "ERROR, \"bash\" must be at least at major version $required_version!" + exit 2 + fi + + # These must be the GNU versions of the commands for tool in $DATE $SED $GREP; do if ! $tool --version | grep -q GNU; then log ERROR "ERROR, \"$tool\" command is not the GNU version, please install!" @@ -84,7 +93,7 @@ END main () { local -r arg="$1"; shift - ensure_gnu + check_dependencies setup case $arg in |
