1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-21 21:55:38 +01:00

Ensure config file is overwritten when saved.

This commit is contained in:
Nick Blakely 2022-09-10 23:01:42 -07:00
parent b9184ba3d9
commit 929801b242

View File

@ -49,8 +49,7 @@
Directory.CreateDirectory(Path.GetDirectoryName(userConfigFilePath)); Directory.CreateDirectory(Path.GetDirectoryName(userConfigFilePath));
using (var file = File.OpenWrite(userConfigFilePath)) using (var streamWriter = new StreamWriter(userConfigFilePath, append: false))
using (var streamWriter = new StreamWriter(file))
{ {
string serializedConfig = JsonConvert.SerializeObject(this.userConfig, Formatting.Indented); string serializedConfig = JsonConvert.SerializeObject(this.userConfig, Formatting.Indented);
streamWriter.Write(serializedConfig); streamWriter.Write(serializedConfig);