Move the global config path into a variable

This commit is contained in:
Hunman 2022-12-30 00:17:38 +01:00
parent 248beffa2f
commit 82bb145cbc

View File

@ -16,6 +16,8 @@ import (
var cfgDir string
func init() {
etcPath := "/etc/itd.toml";
// Set up logger
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
@ -52,7 +54,7 @@ func init() {
setCfgDefaults()
// Load config files
etcProvider := file.Provider("/etc/itd.toml")
etcProvider := file.Provider(etcPath)
cfgProvider := file.Provider(cfgPath)
k.Load(etcProvider, toml.Parser())
k.Load(cfgProvider, toml.Parser())