From de27140c13a619d9199d2837803c0b7bdfca40b4 Mon Sep 17 00:00:00 2001 From: Neil Shen Date: Mon, 13 Aug 2018 18:49:08 +0800 Subject: [PATCH] scripts/check_requirement: match one or more digits (#569) --- scripts/check_requirement.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_requirement.sh b/scripts/check_requirement.sh index 28cff378ca087..5e159e0c2aab1 100755 --- a/scripts/check_requirement.sh +++ b/scripts/check_requirement.sh @@ -92,8 +92,8 @@ fi # Check go if which go &>/dev/null; then # requires go >= 1.8 - GO_VER_1=`go version | awk 'match($0, /([0-9])+(\.[0-9])+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[1];}'` - GO_VER_2=`go version | awk 'match($0, /([0-9])+(\.[0-9])+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[2];}'` + GO_VER_1=`go version | awk 'match($0, /([0-9])+(\.[0-9]+)+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[1];}'` + GO_VER_2=`go version | awk 'match($0, /([0-9])+(\.[0-9]+)+/) { ver = substr($0, RSTART, RLENGTH); split(ver, n, "."); print n[2];}'` if [[ (($GO_VER_1 -eq 1 && $GO_VER_2 -lt 10)) || (($GO_VER_1 -lt 1)) ]]; then echo "Please upgrade Go to 1.10 or later." exit 1