tomo/unix.go

27 lines
545 B
Go
Raw Normal View History

2023-06-30 20:38:51 +00:00
//go:build linux || darwin || freebsd
package tomo
import "os"
import "strings"
import "path/filepath"
2023-09-04 17:48:03 +00:00
var userDataDir string
2023-06-30 20:38:51 +00:00
func init () {
pathVariable := os.Getenv("TOMO_PLUGIN_PATH")
pluginPaths = strings.Split(pathVariable, ":")
pluginPaths = append (
pluginPaths,
"/usr/lib/tomo/plugins",
"/usr/local/lib/tomo/plugins")
homeDir, err := os.UserHomeDir()
if err == nil {
pluginPaths = append (
pluginPaths,
filepath.Join(homeDir, ".local/lib/tomo/plugins"))
}
2023-09-04 17:48:03 +00:00
userDataDir = filepath.Join(homeDir, ".local/share")
2023-06-30 20:38:51 +00:00
}