mirror of
https://github.com/coreybutler/nvm-windows.git
synced 2026-01-16 03:03:11 +08:00
Merge pull request #77 from zonplm/master
fix issues related to showing the arch of installed node
This commit is contained in:
@@ -25,7 +25,17 @@ func GetCurrentVersion() (string, string) {
|
||||
cmd := exec.Command("node","-p","console.log(process.execPath)")
|
||||
str, _ := cmd.Output()
|
||||
file := strings.Trim(regexp.MustCompile("undefined").ReplaceAllString(string(str),"")," \n\r")
|
||||
return v, arch.Bit(file)
|
||||
bit := arch.Bit(file)
|
||||
if (bit == "?"){
|
||||
cmd := exec.Command("node", "-e", "console.log(process.arch)" )
|
||||
str, err := cmd.Output()
|
||||
if (string(str) == "x64") {
|
||||
bit := "64"
|
||||
} else {
|
||||
bit := "32"
|
||||
}
|
||||
}
|
||||
return v, bit
|
||||
}
|
||||
return "Unknown",""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user