Skip to content

Commit

Permalink
Merge pull request #30 from 0x2142/fix-config-file-load
Browse files Browse the repository at this point in the history
Fix config file load if specified by ENV
  • Loading branch information
0x2142 committed Mar 14, 2024
2 parents ffdfaaf + bb92097 commit 0207351
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 0207351

Please sign in to comment.