30 lines
565 B
Go
30 lines
565 B
Go
// +build linux freebsd netbsd openbsd
|
|
|
|
package runner
|
|
|
|
import "os/exec"
|
|
|
|
const (
|
|
// DefaultChromePath is the default path to the google-chrome executable.
|
|
DefaultChromePath = "/usr/bin/google-chrome"
|
|
)
|
|
|
|
// chromeNames are the Chrome executable names to search for in the path.
|
|
var chromeNames = []string{
|
|
"google-chrome",
|
|
"chromium-browser",
|
|
"google-chrome-beta",
|
|
"google-chrome-unstable",
|
|
}
|
|
|
|
func findChromePath() string {
|
|
for _, p := range chromeNames {
|
|
path, err := exec.LookPath(p)
|
|
if err == nil {
|
|
return path
|
|
}
|
|
}
|
|
|
|
return DefaultChromePath
|
|
}
|