aboutsummaryrefslogtreecommitdiff
path: root/config/config_unix.go
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2017-01-16 17:35:36 -0500
committerMitch Riedstra <mitch@riedstra.us>2017-01-16 17:35:36 -0500
commit5078083aa80279724f834305ca52946c7114b2ca (patch)
tree4022334cc6bf251a9c8bc10e46e16bb0a87a37c3 /config/config_unix.go
parent6074026163c8d8e03c5f4a3b72067328e1ab78c5 (diff)
downloadsteam-export-5078083aa80279724f834305ca52946c7114b2ca.tar.gz
steam-export-5078083aa80279724f834305ca52946c7114b2ca.tar.xz
Pull default configuration into the application, add an edit command
Diffstat (limited to 'config/config_unix.go')
-rw-r--r--config/config_unix.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/config/config_unix.go b/config/config_unix.go
new file mode 100644
index 0000000..8f77235
--- /dev/null
+++ b/config/config_unix.go
@@ -0,0 +1,22 @@
+// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
+
+package config
+
+import (
+ "os"
+ "os/exec"
+ "path/filepath"
+)
+
+var (
+ editor string = setEditor()
+ fn string = filepath.Join(os.Getenv("HOME"), "."+configFilename)
+)
+
+func setEditor() string {
+ e := os.Getenv("EDITOR")
+ if e == "" {
+ return "vi"
+ }
+ return e
+}