Decrypt form: remove debug window

This commit is contained in:
Robert McRackan 2021-07-21 07:10:01 -04:00
parent 01de928b7a
commit 6ba8c0ca91
5 changed files with 132 additions and 151 deletions

View file

@ -248,23 +248,29 @@ namespace FileManager
// Directory.Delete(AppDir);
//}
libationFilesPathCache = null;
var startingContents = File.ReadAllText(APPSETTINGS_JSON);
var jObj = JObject.Parse(startingContents);
jObj[LIBATION_FILES_KEY] = directory;
var endingContents = JsonConvert.SerializeObject(jObj, Formatting.Indented);
if (startingContents != endingContents)
{
try { Serilog.Log.Logger.Information("Libation files changed {@DebugInfo}", new { APPSETTINGS_JSON, LIBATION_FILES_KEY, directory }); }
catch { }
File.WriteAllText(APPSETTINGS_JSON, endingContents);
}
if (startingContents == endingContents)
return true;
try
{
Serilog.Log.Logger.Information("Libation files changed {@DebugInfo}", new { APPSETTINGS_JSON, LIBATION_FILES_KEY, directory });
}
catch { }
// now it's set in the file again but no settings have moved yet
File.WriteAllText(APPSETTINGS_JSON, endingContents);
//// attempting this will try to change the settings file which has not yet been moved
// var logPath = Path.Combine(LibationFiles, "Log.log");
// SetWithJsonPath("Serilog.WriteTo[1].Args", "path", logPath);
return true;
}