Skip to content

Commit

Permalink
fix: invalid configuration file gets created
Browse files Browse the repository at this point in the history
In some cases when the configuration file already exist
the configuration file is rewritten with invalid elements.
This commit makes sure to remove the file before
updating with the new configuration.
  • Loading branch information
AdmiringWorm committed Dec 18, 2022
1 parent 07813d2 commit 5cb0bc2
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void SetConfiguration(ConverterConfiguration config)
var directory = Path.GetDirectoryName(configPath);
ioHelpers.EnsureDirectory(directory);

ioHelpers.FileRemove(configPath);
using var writer = ioHelpers.FileOpenWrite(configPath);
using var xmlWriter = XmlWriter.Create(writer, new XmlWriterSettings
{
Expand Down

0 comments on commit 5cb0bc2

Please sign in to comment.