From f639c2c38b6b8777664b8f1adb93e46464e723a0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sun, 7 Jan 2024 07:28:52 -0700 Subject: [PATCH] accidentally comitted my volume configs, fixed bug related to missing userconfig file. --- Controllers/HomeController.cs | 5 +++++ docker-compose.yml | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Controllers/HomeController.cs b/Controllers/HomeController.cs index cbbe21b..af8615b 100644 --- a/Controllers/HomeController.cs +++ b/Controllers/HomeController.cs @@ -55,6 +55,11 @@ namespace CarCareTracker.Controllers { try { + if (!System.IO.File.Exists("config/userConfig.json")) + { + //if file doesn't exist it might be because it's running on a mounted volume in docker. + System.IO.File.WriteAllText("config/userConfig.json", System.Text.Json.JsonSerializer.Serialize(new UserConfig())); + } var configFileContents = System.IO.File.ReadAllText("config/userConfig.json"); var existingUserConfig = System.Text.Json.JsonSerializer.Deserialize(configFileContents); if (existingUserConfig is not null) diff --git a/docker-compose.yml b/docker-compose.yml index 81df8a7..e9b2e61 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,12 +21,7 @@ services: volumes: config: - external: true data: - external: true documents: - external: true images: - external: true log: - external: true