Beispiel #1
0
func getLatestVersionByRemote() string {

	var version string

	// set url
	url := config.GetConfig("registry") + "latest/" + util.SHASUMS

	version = util.GetLatestVersion(url)

	return version

}
Beispiel #2
0
func ReSetConfig() {
	SetConfig(REGISTRY, REGISTRY_VAL)
	SetConfig(NODEROOT, util.GlobalNodePath)

	version, err := util.GetNodeVersion(util.GlobalNodePath + "\\")
	if err != nil {
		P(WARING, "not found global node.exe version, please use '%v'. See '%v'.\n", "gnvm install x.xx.xx -g", "gnvm help install")
		globalversion = GLOBAL_VERSION_VAL
	} else {
		globalversion = version
	}
	SetConfig(GLOBAL_VERSION, globalversion)

	// set url
	url := REGISTRY_VAL + "latest/" + util.SHASUMS
	if latest := util.GetLatestVersion(url); latest != "" {
		latsetversion = latest
	} else {
		latsetversion = LATEST_VERSION_VAL
	}
	SetConfig(LATEST_VERSION, latsetversion)

	P(DEFAULT, "Config file %v init success.\n", configPath)
}