diff --git a/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs b/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs index 9f4523b..cb22eb5 100644 --- a/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs +++ b/Endpoint/Configuration/AppConfig/EnvironmentConfiguration.cs @@ -61,8 +61,12 @@ public static class EnvironmentConfiguration result.AddInMemoryCollection(LoadEnvironment(".env.develop")!); #endif - if (variablesFromFile.TryGetValue("PATH_TO_SAVE", out var data)) - Environment.SetEnvironmentVariable("PATH_TO_SAVE", variablesFromFile["PATH_TO_SAVE"]); + if (!variablesFromFile.TryGetValue("PATH_TO_SAVE", out var data)) + return result.Build(); + + Environment.SetEnvironmentVariable("PATH_TO_SAVE", data); + if (!Directory.Exists(data)) + Directory.CreateDirectory(data); return result.Build(); }