1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Close #105. Merge branch 'deltaxflux-master'

This commit is contained in:
Chris Cummer 2018-06-01 09:13:38 -07:00
commit 779f0a25c3

View File

@ -2,6 +2,7 @@ package system
import (
"os/exec"
"runtime"
"strings"
"github.com/senorprogrammer/wtf/wtf"
@ -18,7 +19,16 @@ func NewSystemInfo() *SystemInfo {
arg := []string{}
cmd := exec.Command("sw_vers", arg...)
var cmd *exec.Cmd
switch runtime.GOOS {
case "linux":
cmd = exec.Command("uname -a", arg...)
case "darwin":
cmd = exec.Command("sw_vers", arg...)
default:
cmd = exec.Command("sw_vers", arg...)
}
raw := wtf.ExecuteCommand(cmd)
for _, row := range strings.Split(raw, "\n") {