diff options
| author | Heinrich 'Henrik' Langos <gumbo2000@noreply@mills.io> | 2023-02-13 22:09:12 +0000 |
|---|---|---|
| committer | James Mills <james@mills.io> | 2023-02-13 22:09:12 +0000 |
| commit | bf1e25949d45958aee1e76b7977affd5b1e92f7b (patch) | |
| tree | 30acd2adc81b1d1a66cff8568f70e0975f14113a | |
| parent | e14f19abd3307556d25b3bce16fb784956ffe8a4 (diff) | |
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>
| -rwxr-xr-x | preflight.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/preflight.sh b/preflight.sh index 06e43c1..24e02ee 100755 --- a/preflight.sh +++ b/preflight.sh @@ -73,9 +73,12 @@ check_goversion() { return 1 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}" return 1 fi |
