Skip to content

Commit 43f29a3

Browse files
committed
Support OpenBSD.
1 parent 9302be2 commit 43f29a3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

browser_openbsd.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package browser
2+
3+
import (
4+
"errors"
5+
"os/exec"
6+
)
7+
8+
var errNoXdgOpen = errors.New("xdg-open: command not found - install xdg-utils from ports(8)")
9+
10+
func openBrowser(url string) error {
11+
err := runCmd("xdg-open", url)
12+
if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
13+
return errNoXdgOpen
14+
}
15+
return err
16+
}

browser_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// +build !linux,!windows,!darwin
1+
// +build !linux,!windows,!darwin,!openbsd
22

33
package browser
44

0 commit comments

Comments
 (0)