Fix go version check for 1.20 and above (#70)
Reviewed-on: https://git.mills.io/prologic/tube/pulls/70 Co-authored-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io> Co-committed-by: Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>
This commit is contained in:
parent
e14f19abd3
commit
bf1e25949d
1 changed files with 5 additions and 2 deletions
|
@ -73,9 +73,12 @@ check_goversion() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gover="$(go version | grep -o -E 'go[0-9]+\.[0-9]+(\.[0-9]+)?')"
|
gover=$(go version | sed -E 's/.*go([0-9]+\.[0-9]+(\.[0-9]+)?).*/\1/')
|
||||||
|
major=$(echo $gover | cut -d. -f1)
|
||||||
|
minor=$(echo $gover | cut -d. -f2)
|
||||||
|
patch=$(echo $gover | cut -d. -f3)
|
||||||
|
|
||||||
if ! go version | grep -E 'go1\.1[789](\.[0-9]+)?' > /dev/null; then
|
if [ "$major" -lt "1" ] || [ "$major" -eq "1" -a "$minor" -lt "17" ] ; then
|
||||||
log2 "Go 1.17+ is required, found ${gover}"
|
log2 "Go 1.17+ is required, found ${gover}"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue