diff options
author | Alexey Yerin <yyp@disroot.org> | 2021-04-29 13:05:41 +0300 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-04-29 13:23:38 +0200 |
commit | 43bc9cadd1098205c81ed767b7c52fc94c292540 (patch) | |
tree | 43a39ac02a5d9c2bca6746f4865f1758c4afe492 /cmd | |
parent | Make mouse support optional (diff) |
Use path.Join to construct config file path
It would make it work on non-Unix systems and also handle things like
.. in the configuration option
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/senpai/main.go | 3 | ||||
-rw-r--r-- | cmd/test/main.go | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/cmd/senpai/main.go b/cmd/senpai/main.go index 5f7933d..d428ccf 100644 --- a/cmd/senpai/main.go +++ b/cmd/senpai/main.go @@ -5,6 +5,7 @@ import ( "log" "math/rand" "os" + "path" "time" "git.sr.ht/~taiite/senpai" @@ -29,7 +30,7 @@ func main() { if err != nil { log.Panicln(err) } - configPath = configDir + "/senpai/senpai.yaml" + configPath = path.Join(configDir, "senpai", "senpai.yaml") } cfg, err := senpai.LoadConfigFile(configPath) diff --git a/cmd/test/main.go b/cmd/test/main.go index 05257f8..6ed7f4e 100644 --- a/cmd/test/main.go +++ b/cmd/test/main.go @@ -7,6 +7,7 @@ import ( "io" "net" "os" + "path" "git.sr.ht/~taiite/senpai" "git.sr.ht/~taiite/senpai/irc" @@ -110,7 +111,7 @@ func parseFlags() { if err != nil { panic(err) } - configPath = configDir + "/senpai/senpai.yaml" + configPath = path.Join(configDir, "senpai", "senpai.yaml") } cfg, err := senpai.LoadConfigFile(configPath) |