parent
bba7547156
commit
b4fc206a7b
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python3
|
||||||
import json
|
import json
|
||||||
import urllib
|
import urllib.request
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -19,9 +19,9 @@ def splitver(x):
|
|||||||
return v
|
return v
|
||||||
|
|
||||||
ver = sys.argv[1]
|
ver = sys.argv[1]
|
||||||
d = json.loads(urllib.urlopen('https://go.dev/dl/?mode=json&include=all').read())
|
d = json.loads(urllib.request.urlopen('https://go.dev/dl/?mode=json&include=all').read())
|
||||||
ds = sorted(d, reverse=True, key=lambda it: splitver(it['version'][2:]))
|
ds = sorted(d, reverse=True, key=lambda it: splitver(it['version'][2:]))
|
||||||
for x in ds:
|
for x in ds:
|
||||||
if x['version'][:len(ver)] == ver:
|
if x['version'][:len(ver)] == ver:
|
||||||
print x['version']
|
print(x['version'])
|
||||||
exit(0)
|
exit(0)
|
||||||
|
@ -25,7 +25,7 @@ if [ "$GOVERSION" = "gotip" ]; then
|
|||||||
cd -
|
cd -
|
||||||
else
|
else
|
||||||
echo Finding latest patch version for $GOVERSION
|
echo Finding latest patch version for $GOVERSION
|
||||||
GOVERSION=$(python _scripts/latestver.py $GOVERSION)
|
GOVERSION=$(python3 _scripts/latestver.py $GOVERSION)
|
||||||
echo Go $GOVERSION on $ARCH
|
echo Go $GOVERSION on $ARCH
|
||||||
cd $TMPDIR
|
cd $TMPDIR
|
||||||
curl -sSL "https://storage.googleapis.com/golang/$GOVERSION.darwin-$ARCH.tar.gz" | tar -xz
|
curl -sSL "https://storage.googleapis.com/golang/$GOVERSION.darwin-$ARCH.tar.gz" | tar -xz
|
||||||
|
Loading…
Reference in New Issue
Block a user