Merge branch 'master' into master

This commit is contained in:
Corey Butler
2018-08-11 18:53:17 -05:00
committed by GitHub
14 changed files with 451 additions and 75 deletions

View File

@@ -115,6 +115,7 @@ func main() {
env.proxy = detail
saveSettings()
}
//case "update": update()
case "node_mirror": setNodeMirror(detail)
case "npm_mirror": setNpmMirror(detail)
@@ -399,7 +400,7 @@ func use(version string, cpuarch string) {
if !runElevated(fmt.Sprintf(`"%s" cmd /C rmdir "%s"`,
filepath.Join(env.root, "elevate.cmd"),
filepath.Clean(env.symlink))) {
return
return
}
}
@@ -408,7 +409,7 @@ func use(version string, cpuarch string) {
filepath.Join(env.root, "elevate.cmd"),
filepath.Clean(env.symlink),
filepath.Join(env.root, "v"+version))) {
return
return
}
// Use the assigned CPU architecture
@@ -434,6 +435,20 @@ func use(version string, cpuarch string) {
fmt.Println("Now using node v"+version+" ("+cpuarch+"-bit)")
}
func useArchitecture(a string) {
if strings.ContainsAny("32",os.Getenv("PROCESSOR_ARCHITECTURE")) {
fmt.Println("This computer only supports 32-bit processing.")
return
}
if a == "32" || a == "64" {
env.arch = a
saveSettings()
fmt.Println("Set to "+a+"-bit mode")
} else {
fmt.Println("Cannot set architecture to "+a+". Must be 32 or 64 are acceptable values.")
}
}
func list(listtype string) {
if listtype == "" {
listtype = "installed"
@@ -548,7 +563,7 @@ func disable() {
if !runElevated(fmt.Sprintf(`"%s" cmd /C rmdir "%s"`,
filepath.Join(env.root, "elevate.cmd"),
filepath.Clean(env.symlink))) {
return
return
}
fmt.Println("nvm disabled")