Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support x.y version family as a version

  • Loading branch information...
commit 7d5ac87c0c99cc7e4aba50a807cf300527f9a884 1 parent 3b492b4
@isaacs authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 nave.sh
View
11 nave.sh
@@ -224,9 +224,20 @@ ver () {
version="${version/v/}"
case $version in
latest | stable) nave_$version ;;
+ ?.?) nave_version_family "$version" ;;
*) echo $version ;;
esac
}
+
+nave_version_family () {
+ local family="$1"
+ family="${family/v/}"
+ curl -s http://nodejs.org/dist/ \
+ | egrep -o $family'\.[0-9]+' \
+ | sort -u -k 1,1n -k 2,2n -k 3,3n -t . \
+ | tail -n1
+}
+
nave_latest () {
curl -s http://nodejs.org/dist/ \
| egrep -o '[0-9]+\.[0-9]+\.[0-9]+' \
Please sign in to comment.
Something went wrong with that request. Please try again.