2014-02-04 20:11:26 +04:00
|
|
|
// +build !windows,!darwin
|
|
|
|
|
|
|
|
package open
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os/exec"
|
|
|
|
"path"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
func open(input string) *exec.Cmd {
|
2014-02-05 05:55:06 +04:00
|
|
|
// http://andrewbrookins.com/tech/golang-get-directory-of-the-current-file/
|
|
|
|
_, file, _, _ := runtime.Caller(1)
|
2014-02-04 20:11:26 +04:00
|
|
|
app := path.Join(path.Dir(file), "..", "vendor", "xdg-open")
|
|
|
|
return exec.Command(app, input)
|
|
|
|
}
|
|
|
|
|
|
|
|
func openWith(input string, appName string) *exec.Cmd {
|
|
|
|
return exec.Command(appName, input)
|
|
|
|
}
|