mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-14 07:03:17 +08:00
now checks if input version is greater than latest
This commit is contained in:
@@ -119,7 +119,7 @@ func update() {
|
||||
// }
|
||||
}
|
||||
|
||||
func checkVersionExceedsLatest(version string) 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.+")
|
||||
@@ -155,7 +155,7 @@ func install(version string, cpuarch string) {
|
||||
cpuarch = arch.Validate(cpuarch)
|
||||
}
|
||||
|
||||
if(checkVersionExceedsLatest(version)) {
|
||||
if CheckVersionExceedsLatest(version) {
|
||||
fmt.Println("Node.js v"+version+" is not yet released or available.")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user