Merge pull request #791 from hargata/Hargata/769

Fixed backup restoration for userConfig.json
This commit is contained in:
Hargata Softworks
2025-01-08 20:38:52 -07:00
committed by GitHub
2 changed files with 6 additions and 6 deletions

View File

@@ -105,7 +105,7 @@ namespace CarCareTracker.Helper
var translationPath = Path.Combine(tempPath, "translations");
var dataPath = Path.Combine(tempPath, StaticHelper.DbName);
var widgetPath = Path.Combine(tempPath, StaticHelper.AdditionalWidgetsPath);
var configPath = Path.Combine(tempPath, StaticHelper.UserConfigPath);
var configPath = Path.Combine(tempPath, StaticHelper.LegacyUserConfigPath);
if (Directory.Exists(imagePath))
{
var existingPath = Path.Combine(_webEnv.ContentRootPath, "data", "images");
@@ -186,9 +186,9 @@ namespace CarCareTracker.Helper
if (File.Exists(configPath))
{
//check if config folder exists.
if (!Directory.Exists("config/"))
if (!Directory.Exists("data/config"))
{
Directory.CreateDirectory("config/");
Directory.CreateDirectory("data/config");
}
File.Move(configPath, StaticHelper.UserConfigPath, true);
}

View File

@@ -15,6 +15,7 @@ namespace CarCareTracker.Helper
public const string VersionNumber = "1.4.3";
public const string DbName = "data/cartracker.db";
public const string UserConfigPath = "data/config/userConfig.json";
public const string LegacyUserConfigPath = "config/userConfig.json";
public const string AdditionalWidgetsPath = "data/widgets.html";
public const string GenericErrorMessage = "An error occurred, please try again later";
public const string ReminderEmailTemplate = "defaults/reminderemailtemplate.txt";
@@ -363,10 +364,9 @@ namespace CarCareTracker.Helper
var docsPath = Path.Combine(webRootPath, "documents");
var translationPath = Path.Combine(webRootPath, "translations");
var tempPath = Path.Combine(webRootPath, "temp");
var configPath = "config/userConfig.json";
if (File.Exists(configPath))
if (File.Exists(LegacyUserConfigPath))
{
File.Move(configPath, UserConfigPath, true);
File.Move(LegacyUserConfigPath, UserConfigPath, true);
}
if (Directory.Exists(imagePath))
{