From 50484eadd50e233f248f59d82ebc483dad4c3a2b Mon Sep 17 00:00:00 2001 From: garrettladley Date: Fri, 16 Feb 2024 21:36:31 -0500 Subject: [PATCH] .example_backend_env fixes --- backend/src/config/config.go | 2 +- backend/src/config/local.go | 6 +++--- .example_env => config/.example_backend_env | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename .example_env => config/.example_backend_env (100%) diff --git a/backend/src/config/config.go b/backend/src/config/config.go index 947f4cc5d..be6546a5e 100644 --- a/backend/src/config/config.go +++ b/backend/src/config/config.go @@ -66,7 +66,7 @@ func GetConfiguration(path string) (*Settings, error) { v.AddConfigPath(path) if environment == EnvironmentLocal { - return readLocal(v) + return readLocal(v, path) } else { return readProd(v) } diff --git a/backend/src/config/local.go b/backend/src/config/local.go index d480397c5..8b3ef1f67 100644 --- a/backend/src/config/local.go +++ b/backend/src/config/local.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/viper" ) -func readLocal(v *viper.Viper) (*Settings, error) { +func readLocal(v *viper.Viper, path string) (*Settings, error) { var intermediateSettings intermediateSettings env := string(EnvironmentLocal) @@ -27,9 +27,9 @@ func readLocal(v *viper.Viper) (*Settings, error) { return nil, fmt.Errorf("failed to convert intermediate settings into final settings: %w", err) } - err = godotenv.Load(".example_env") + err = godotenv.Load(fmt.Sprintf("%s/.example_backend_env", path)) if err != nil { - return nil, fmt.Errorf("failed to load .example_env: %w", err) + return nil, fmt.Errorf("failed to load %s/.example_backend_env: %w", path, err) } pineconeSettings, err := readPineconeSettings() diff --git a/.example_env b/config/.example_backend_env similarity index 100% rename from .example_env rename to config/.example_backend_env