load -c <file> if exists

This commit is contained in:
2026-07-06 09:09:23 +02:00
parent 392249f483
commit 035194b6f0

View File

@@ -121,10 +121,11 @@ func getDefaultPath() string {
func (conf *Config) Init() error { func (conf *Config) Init() error {
DefaultConfig := getDefaultPath() DefaultConfig := getDefaultPath()
switch { if conf.ConfigFile == "" && fileExists(DefaultConfig) {
case fileExists(DefaultConfig):
conf.ConfigFile = DefaultConfig conf.ConfigFile = DefaultConfig
fallthrough }
switch {
case conf.ConfigFile != "": case conf.ConfigFile != "":
if err := conf.LoadConfig(); err != nil { if err := conf.LoadConfig(); err != nil {
return err return err