@@ -18,7 +18,7 @@ import (
1818)
1919
2020const (
21- NvmVersion = "1.0.6 "
21+ NvmVersion = "1.1.0 "
2222)
2323
2424type Environment struct {
@@ -120,11 +120,11 @@ func update() {
120120}
121121
122122func CheckVersionExceedsLatest (version string ) bool {
123- content := web .GetRemoteTextFile ("http://nodejs.org/dist/latest/SHASUMS .txt" )
123+ content := web .GetRemoteTextFile ("http://nodejs.org/dist/latest/SHASUMS256 .txt" )
124124 re := regexp .MustCompile ("node-v(.+)+msi" )
125125 reg := regexp .MustCompile ("node-v|-x.+" )
126126 latest := reg .ReplaceAllString (re .FindString (content ),"" )
127-
127+
128128 if version <= latest {
129129 return false
130130 } else {
@@ -155,6 +155,14 @@ func install(version string, cpuarch string) {
155155 cpuarch = arch .Validate (cpuarch )
156156 }
157157
158+ // If user specifies "latest" version, find out what version is
159+ if version == "latest" {
160+ content := web .GetRemoteTextFile ("http://nodejs.org/dist/latest/SHASUMS256.txt" )
161+ re := regexp .MustCompile ("node-v(.+)+msi" )
162+ reg := regexp .MustCompile ("node-v|-x.+" )
163+ version = reg .ReplaceAllString (re .FindString (content ),"" )
164+ }
165+
158166 if CheckVersionExceedsLatest (version ) {
159167 fmt .Println ("Node.js v" + version + " is not yet released or available." )
160168 return
@@ -165,14 +173,6 @@ func install(version string, cpuarch string) {
165173 return
166174 }
167175
168- // If user specifies "latest" version, find out what version is
169- if version == "latest" {
170- content := web .GetRemoteTextFile ("http://nodejs.org/dist/latest/SHASUMS.txt" )
171- re := regexp .MustCompile ("node-v(.+)+msi" )
172- reg := regexp .MustCompile ("node-v|-x.+" )
173- version = reg .ReplaceAllString (re .FindString (content ),"" )
174- }
175-
176176 // Check to see if the version is already installed
177177 if ! node .IsVersionInstalled (env .root ,version ,cpuarch ) {
178178
0 commit comments