From d23cf924c99f52816c9a0fdc496e5df7580d6203 Mon Sep 17 00:00:00 2001 From: "\"muxator ext:(%22)" Date: Tue, 31 Jul 2018 12:44:17 +0200 Subject: [PATCH] installDeps: replace GNU specific long options whith short ones Long options are only present in GNU cut, and we aim to also support other platforms. --- bin/installDeps.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/installDeps.sh b/bin/installDeps.sh index d8080c51..47373a5f 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -14,8 +14,10 @@ require_minimal_version() { REQUIRED_MAJOR="$3" REQUIRED_MINOR="$4" - DETECTED_MAJOR=$(echo $VERSION_STRING | cut --only-delimited --delimiter "." --fields 1) - DETECTED_MINOR=$(echo $VERSION_STRING | cut --only-delimited --delimiter "." --fields 2) + # Flag -s (--only-delimited on GNU cut) ensures no string is returned + # when there is no match + DETECTED_MAJOR=$(echo $VERSION_STRING | cut -s -d "." -f 1) + DETECTED_MINOR=$(echo $VERSION_STRING | cut -s -d "." -f 2) if [ -z "$DETECTED_MAJOR" ]; then printf 'Cannot extract %s major version from version string "%s"\n' "$PROGRAM_LABEL" "$VERSION_STRING" >&2