Skip to content

Commit

Permalink
Merge pull request coreybutler#77 from zonplm/master
Browse files Browse the repository at this point in the history
fix issues related to showing the arch of installed node
  • Loading branch information
coreybutler committed Aug 4, 2015
2 parents 9a33698 + 1c398a4 commit 32b8754
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/nvm/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",""
}
Expand Down

0 comments on commit 32b8754

Please sign in to comment.