Skip to content

Commit

Permalink
Quick fix for #105
Browse files Browse the repository at this point in the history
- add lsb_release because sw_vers doesn't work on linux 
- add system check
  • Loading branch information
deltax committed Jun 1, 2018
1 parent fe67bed commit 0d60c83
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion system/system_info.go
Expand Up @@ -18,7 +18,15 @@ func NewSystemInfo() *SystemInfo {

arg := []string{}

cmd := exec.Command("sw_vers", arg...)
switch runtime.GOOS {
case "linux":
cmd := exec.Command("lsb_release -a", arg...)
case "darwin":
cmd := exec.Command("sw_vers", arg...)
default:
return ""
}

raw := wtf.ExecuteCommand(cmd)

for _, row := range strings.Split(raw, "\n") {
Expand Down

0 comments on commit 0d60c83

Please sign in to comment.