Initial commit
This commit is contained in:
24
internal/config/configpath_bsd.go
Normal file
24
internal/config/configpath_bsd.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build darwin || freebsd || openbsd || netbsd || dragonfly
|
||||
|
||||
// @tag config
|
||||
// @tag platform:bsd
|
||||
package config
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// DefaultConfigPaths returns the config file search paths for BSD and macOS.
|
||||
// Looks up ~/.pekoe.json first, then /usr/local/etc/pekoe/config.json.
|
||||
func DefaultConfigPaths() []string {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return []string{"/usr/local/etc/pekoe/config.json"}
|
||||
}
|
||||
|
||||
return []string{
|
||||
filepath.Join(home, ".pekoe.json"),
|
||||
"/usr/local/etc/pekoe/config.json",
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user