forked from mirror/open-golang
Merge pull request #7 from Byron/master
Adjusted linux open-code to assume existence of xdg-open.
This commit is contained in:
commit
ba570a1119
|
@ -4,15 +4,10 @@ package open
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
|
||||||
"runtime"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func open(input string) *exec.Cmd {
|
func open(input string) *exec.Cmd {
|
||||||
// http://andrewbrookins.com/tech/golang-get-directory-of-the-current-file/
|
return exec.Command("xdg-open", input)
|
||||||
_, file, _, _ := runtime.Caller(1)
|
|
||||||
app := path.Join(path.Dir(file), "..", "vendor", "xdg-open")
|
|
||||||
return exec.Command(app, input)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func openWith(input string, appName string) *exec.Cmd {
|
func openWith(input string, appName string) *exec.Cmd {
|
||||||
|
|
Loading…
Reference in New Issue