A cross-platform service manager.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
303 B

// +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
}