Skip to content

Commit

Permalink
Ensure force is taken into account when itterating over all files
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Nov 20, 2024
1 parent ccb780f commit 6055f4f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/Elastic.Markdown/DocumentationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ public async Task GenerateAll(Cancel ctx)

await Parallel.ForEachAsync(DocumentationSet.Files, ctx, async (file, token) =>
{
if (offendingFiles.Contains(file.SourceFile.FullName))
_logger.LogInformation($"Re-evaluating {file.SourceFile.FullName}");
else if (file.SourceFile.LastWriteTimeUtc <= outputSeenChanges)
return;
if (!Context.Force)
{
if (offendingFiles.Contains(file.SourceFile.FullName))
_logger.LogInformation($"Re-evaluating {file.SourceFile.FullName}");
else if (file.SourceFile.LastWriteTimeUtc <= outputSeenChanges)
return;
}

_logger.LogTrace($"{file.SourceFile.FullName}");
var item = Interlocked.Increment(ref handledItems);
var outputFile = OutputFile(file.RelativePath);
if (file is MarkdownFile markdown)
Expand Down
3 changes: 1 addition & 2 deletions src/docs-builder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Actions.Core.Extensions;
using ConsoleAppFramework;
using Documentation.Builder.Cli;
using Documentation.Builder.Diagnostics;
using Elastic.Markdown.Diagnostics;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand All @@ -23,7 +22,7 @@
c.SingleLine = true;
c.IncludeScopes = true;
c.UseUtcTimestamp = true;
c.TimestampFormat = "[yyyy-MM-ddTHH:mm:ss] ";
c.TimestampFormat = Environment.UserInteractive ? ":: " : "[yyyy-MM-ddTHH:mm:ss] ";
});
});
services.AddSingleton<DiagnosticsChannel>();
Expand Down

0 comments on commit 6055f4f

Please sign in to comment.