Skip to content

Commit

Permalink
Fixed a bug with file cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaglick committed Feb 3, 2023
1 parent 1bdf285 commit e990cb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.0.0-beta.67

- Fixed a bug that still resulted in file cleaning even when `CleanMode.None` is set (I.e. `--noclean`).

# 1.0.0-beta.66

- Fixed a bug in `ExtractFrontMatter` to ensure front matter is extracted when the delimiter is on the last line of the file.
Expand Down
15 changes: 9 additions & 6 deletions src/core/Statiq.Core/Execution/FileCleaner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,16 @@ public virtual async Task CleanBeforeExecutionAsync()
}

// Clean if we need to
if (CleanMode == CleanMode.Full || _firstExecution)
if (CleanMode != CleanMode.None)
{
CleanDirectory(_fileSystem.GetOutputDirectory(), "output");
}
else if (CleanMode == CleanMode.Self)
{
CleanSelf();
if (CleanMode == CleanMode.Full || _firstExecution)
{
CleanDirectory(_fileSystem.GetOutputDirectory(), "output");
}
else if (CleanMode == CleanMode.Self)
{
CleanSelf();
}
}

_firstExecution = false;
Expand Down

0 comments on commit e990cb1

Please sign in to comment.