Skip to content

Commit

Permalink
now checks if input version is greater than latest
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulroy9202 committed Mar 3, 2015
1 parent 0265573 commit b4b809c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ func update() {
// }
}

fun checkVersionExceedsLatest(version) bool{
func checkVersionExceedsLatest(version string) bool{
content := web.GetRemoteTextFile("http://nodejs.org/dist/latest/SHASUMS.txt")
re := regexp.MustCompile("node-v(.+)+msi")
reg := regexp.MustCompile("node-v|-x.+")
latest = reg.ReplaceAllString(re.FindString(content),"")
latest := reg.ReplaceAllString(re.FindString(content),"")

if version < latest {
return false
Expand Down Expand Up @@ -156,7 +156,7 @@ func install(version string, cpuarch string) {
}

if(checkVersionExceedsLatest(version)) {
fmt.Println("Node.js v"+version+" is not yet available.")
fmt.Println("Node.js v"+version+" is not yet released or available.")
return
}

Expand Down

0 comments on commit b4b809c

Please sign in to comment.