aboutsummaryrefslogtreecommitdiff
path: root/config/config_unix.go
blob: 8f772356f4e83dea6bcfb9918928b7d28f3b9175 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}