提交 b4b809c9 编写于 作者: R rahulroy9202

now checks if input version is greater than latest

上级 0265573b
......@@ -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
......@@ -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
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册