serviceman/installer/install_notwindows.go

19 lines
303 B
Go
Raw Normal View History

2019-07-01 08:44:48 +00:00
// +build !windows
package installer
import (
"os/exec"
"strings"
)
func whereIs(exe string) (string, error) {
2019-07-03 05:51:30 +00:00
// TODO use exec.LookPath instead
2019-07-01 08:44:48 +00:00
cmd := exec.Command("command", "-v", exe)
out, err := cmd.Output()
if nil != err {
return "", err
}
return strings.TrimSpace(string(out)), nil
}