Skip to content

Commit

Permalink
Fix version sort.
Browse files Browse the repository at this point in the history
  • Loading branch information
udhos committed Feb 10, 2018
1 parent 95c9034 commit b440c71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion update-golang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion update-golang.sh.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
66f55a1ef6ae3502c6d1ef9dcc4e35f6605fddaee8c964eaffca01d5c2ed6463 update-golang.sh
86b5b4d0dc3050d05542f7fe9c3114dfec3416ec2e4d27e8afb5b9e08ad0dde3 update-golang.sh

0 comments on commit b440c71

Please sign in to comment.