mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-24 15:15:37 +01:00
Merge pull request #15 from ncblakely/users/tos/configwrite
Ensure config file is overwritten when saved.
This commit is contained in:
commit
4e81ab7521
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user