From bb920974e5d19b85983d0868f558f58933c3f667 Mon Sep 17 00:00:00 2001 From: Matt Schmitz Date: Thu, 14 Mar 2024 19:48:39 -0400 Subject: [PATCH] Fix config file load if specified by ENV --- config/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index a49fcd6..114138d 100644 --- a/config/config.go +++ b/config/config.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "path/filepath" "strings" "github.com/kkyr/fig" @@ -103,7 +104,8 @@ func LoadConfig(configFile string) { // Load Config file log.Print("Loading config file: ", configFile) - err := fig.Load(&ConfigData, fig.File(configFile), fig.UseEnv("FN")) + + err := fig.Load(&ConfigData, fig.File(filepath.Base(configFile)), fig.Dirs(filepath.Dir(configFile)), fig.UseEnv("FN")) if err != nil { log.Fatal("Failed to load config file! Error: ", err) }