Skip to content

Commit

Permalink
Fix config file load if specified by ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2142 committed Mar 14, 2024
1 parent ffdfaaf commit bb92097
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
"path/filepath"
"strings"

"github.com/kkyr/fig"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit bb92097

Please sign in to comment.