Skip to content

Commit

Permalink
remove old results, otherwise, the file will be overwritten and remai…
Browse files Browse the repository at this point in the history
…ning old content might stay untouched
  • Loading branch information
adamsitnik committed Feb 27, 2017
1 parent fe33dd8 commit 7d0d737
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/BenchmarkDotNet.Core/Exporters/ExporterBase.cs
Expand Up @@ -16,6 +16,11 @@ public abstract class ExporterBase : IExporter
public IEnumerable<string> ExportToFiles(Summary summary, ILogger consoleLogger)
{
var filePath = $"{Path.Combine(summary.ResultsDirectoryPath, summary.Title)}-{FileCaption}{FileNameSuffix}.{FileExtension}";
if (File.Exists(filePath))
{
File.Delete(filePath);
}

using (var stream = Portability.StreamWriter.FromPath(filePath))
{
ExportToLog(summary, new StreamLogger(stream));
Expand Down

0 comments on commit 7d0d737

Please sign in to comment.