2
1
mirror of https://github.com/therootcompany/serviceman.git synced 2025-12-23 13:28:40 +00:00
serviceman/installer/install_notwindows.go

19 lines
303 B
Go

// +build !windows
package installer
import (
"os/exec"
"strings"
)
func whereIs(exe string) (string, error) {
// TODO use exec.LookPath instead
cmd := exec.Command("command", "-v", exe)
out, err := cmd.Output()
if nil != err {
return "", err
}
return strings.TrimSpace(string(out)), nil
}