From 82892631f8299f09192c51ec202339f59910cb4b Mon Sep 17 00:00:00 2001 From: krichard1212 Date: Thu, 12 Sep 2024 09:17:27 +0200 Subject: [PATCH] Support for both TRUE and true in NONVIPER_CONFIG env var --- lib/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config.go b/lib/config.go index 6a3d4c1..893b357 100644 --- a/lib/config.go +++ b/lib/config.go @@ -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")) @@ -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)