fix: create directory if not exist

This commit is contained in:
Polianin Nikita 2024-07-04 22:40:59 +03:00
parent 098fca5df8
commit 2041a187e7

View File

@ -61,8 +61,12 @@ public static class EnvironmentConfiguration
result.AddInMemoryCollection(LoadEnvironment(".env.develop")!); result.AddInMemoryCollection(LoadEnvironment(".env.develop")!);
#endif #endif
if (variablesFromFile.TryGetValue("PATH_TO_SAVE", out var data)) if (!variablesFromFile.TryGetValue("PATH_TO_SAVE", out var data))
Environment.SetEnvironmentVariable("PATH_TO_SAVE", variablesFromFile["PATH_TO_SAVE"]); return result.Build();
Environment.SetEnvironmentVariable("PATH_TO_SAVE", data);
if (!Directory.Exists(data))
Directory.CreateDirectory(data);
return result.Build(); return result.Build();
} }