mirror of
https://github.com/netchx/netch.git
synced 2026-03-14 17:43:18 +08:00
Fix Confiugration.Save not touch replace target file
This commit is contained in:
@@ -105,6 +105,9 @@ namespace Netch.Utils
|
||||
await JsonSerializer.SerializeAsync(fileStream, Global.Settings, JsonSerializerOptions).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!File.Exists(FileFullName))
|
||||
File.Create(FileFullName);
|
||||
|
||||
File.Replace(tempFile, FileFullName, BackupFileFullName);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user