File: browser_freebsd.go

package info (click to toggle)
golang-github-cli-browser 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 120 kB
  • sloc: makefile: 3
file content (15 lines) | stat: -rw-r--r-- 247 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package browser

import (
	"errors"
	"fmt"
	"os/exec"
)

func openBrowser(url string) error {
	err := runCmd("xdg-open", url)
	if errors.Is(err, exec.ErrNotFound) {
		return fmt.Errorf("%w - install xdg-utils from ports(8)", err)
	}
	return err
}