diff --git a/update-golang.sh b/update-golang.sh index dc95345..e52fb01 100755 --- a/update-golang.sh +++ b/update-golang.sh @@ -58,6 +58,11 @@ show_version() { show_version +scan_versions() { + local fetch="$*" + $fetch https://golang.org/doc/devel/release.html | grep -E -o 'go[0-9\.]+' | grep -E -o '[0-9]\.[0-9]+(\.[0-9]+)?' | sort -V | uniq +} + find_latest() { local last= local fetch= @@ -66,7 +71,7 @@ find_latest() { else fetch="curl --silent" fi - last=$($fetch https://golang.org/doc/devel/release.html | grep -E -o 'go[0-9\.]+' | grep -E -o '[0-9]\.[0-9]+(\.[0-9]+)?' | sort | uniq | tail -1) + last=$(scan_versions $fetch | tail -1) if echo "$last" | grep -q -E '[0-9]\.[0-9]+(\.[0-9]+)?'; then msg find_latest: found last release: "$last" release=$last diff --git a/update-golang.sh.sha256 b/update-golang.sh.sha256 index 0a0f515..e772141 100644 --- a/update-golang.sh.sha256 +++ b/update-golang.sh.sha256 @@ -1 +1 @@ -66f55a1ef6ae3502c6d1ef9dcc4e35f6605fddaee8c964eaffca01d5c2ed6463 update-golang.sh +86b5b4d0dc3050d05542f7fe9c3114dfec3416ec2e4d27e8afb5b9e08ad0dde3 update-golang.sh