Skip to content

Commit

Permalink
scripts/check_requirement: match one or more digits (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored and QueenyJin committed Aug 13, 2018
1 parent b0b94a5 commit de27140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/check_requirement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de27140

Please sign in to comment.