From 2d6621c371ff6eb9b7189a1fec84270f98c88530 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 20 Nov 2024 15:40:32 +0100 Subject: [PATCH] Ensure force is taken into account when itterating over all files (#82) --- src/Elastic.Markdown/DocumentationGenerator.cs | 12 ++++++++---- src/docs-builder/Program.cs | 3 +-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Elastic.Markdown/DocumentationGenerator.cs b/src/Elastic.Markdown/DocumentationGenerator.cs index 5ec176d..a8b2ce3 100644 --- a/src/Elastic.Markdown/DocumentationGenerator.cs +++ b/src/Elastic.Markdown/DocumentationGenerator.cs @@ -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) diff --git a/src/docs-builder/Program.cs b/src/docs-builder/Program.cs index 4d31873..e10c1d9 100644 --- a/src/docs-builder/Program.cs +++ b/src/docs-builder/Program.cs @@ -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; @@ -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();