From 05ac2d7bf3e780d62a89b5129d6ecfc0dfd85a6d Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 4 Sep 2014 12:56:57 +0200 Subject: [PATCH] Adjusted linux open-code to assume existence of xdg-open. The current implentation didn't work without a side-by-side file, which somewhat reduces the usefulness of this library. See https://github.com/skratchdot/open-golang/issues/2 . --- open/exec.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/open/exec.go b/open/exec.go index 909851a..cc37339 100644 --- a/open/exec.go +++ b/open/exec.go @@ -4,15 +4,10 @@ package open import ( "os/exec" - "path" - "runtime" ) func open(input string) *exec.Cmd { - // http://andrewbrookins.com/tech/golang-get-directory-of-the-current-file/ - _, file, _, _ := runtime.Caller(1) - app := path.Join(path.Dir(file), "..", "vendor", "xdg-open") - return exec.Command(app, input) + return exec.Command("xdg-open", input) } func openWith(input string, appName string) *exec.Cmd {