diff --git a/system/system_info.go b/system/system_info.go index d255bde4..6773fe0e 100644 --- a/system/system_info.go +++ b/system/system_info.go @@ -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") {