Skip to content

Commit

Permalink
Support for both TRUE and true in NONVIPER_CONFIG env var
Browse files Browse the repository at this point in the history
  • Loading branch information
krichard1212 committed Sep 12, 2024
1 parent cb6e46a commit 8289263
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func init() {
viperCfg.SetConfigName("config")
viperCfg.SetConfigType("yaml")

if os.Getenv("NONVIPER_CONFIG") != "true" {
if strings.ToLower(os.Getenv("NONVIPER_CONFIG")) != "true" {
configDir, err := findConfigPath()
if err != nil {
print(os.Getenv("NONVIPER_CONFIG"))
Expand All @@ -137,7 +137,7 @@ func init() {
}
viperCfg.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viperCfg.SetDefault("providers.openai.base_url", "https://api.openai.com/v1")
if os.Getenv("NONVIPER_CONFIG") != "true" {
if strings.ToLower(os.Getenv("NONVIPER_CONFIG")) != "true" {
err := viperCfg.ReadInConfig()
if err != nil {
panic(err)
Expand Down

0 comments on commit 8289263

Please sign in to comment.