diff --git a/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs b/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs index fe90c2c..e729071 100644 --- a/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs +++ b/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs @@ -46,6 +46,10 @@ public static class EnvironmentConfiguration { var variablesFromFile = LoadEnvironment(".env"); +#if DEBUG + LoadEnvironment(".env.develop").ToList().ForEach(x => variablesFromFile.Add(x.Key, x.Value)); +#endif + var environmentVariables = Environment.GetEnvironmentVariables() .OfType() .ToDictionary( @@ -57,9 +61,8 @@ public static class EnvironmentConfiguration .AddInMemoryCollection(environmentVariables!) .AddInMemoryCollection(variablesFromFile!); -#if DEBUG - result.AddInMemoryCollection(LoadEnvironment(".env.develop")!); -#endif + + if (!variablesFromFile.TryGetValue("PATH_TO_SAVE", out var data)) return result.Build();