about summary refs log tree commit diff stats
path: root/lib/open_darwin.go
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-02 18:21:34 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-04 10:58:33 -0400
commit1bb1a8015659e0cfde45be9fe9440dbb254680cf (patch)
tree4ee9e875ed33f9d851a71c26d5a721c9ea4e9b59 /lib/open_darwin.go
parent687f1d8c1a31176c3d94e1c4f9049f011cd339ad (diff)
downloadaerc-1bb1a8015659e0cfde45be9fe9440dbb254680cf.tar.gz
Use "open" instead of "xdg-open" on Darwin systems
Diffstat (limited to 'lib/open_darwin.go')
-rw-r--r--lib/open_darwin.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/open_darwin.go b/lib/open_darwin.go
new file mode 100644
index 0000000..0ffd9a1
--- /dev/null
+++ b/lib/open_darwin.go
@@ -0,0 +1,10 @@
+package lib
+
+import (
+	"os/exec"
+)
+
+func OpenFile(filename string) error {
+	cmd := exec.Command("open", filename)
+	return cmd.Run()
+}