Skip to content

Commit

Permalink
fix double log message
Browse files Browse the repository at this point in the history
(cherry picked from commit 6f375b0)
  • Loading branch information
Mpdreamz committed Nov 20, 2024
1 parent 2195124 commit ac5b499
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Elastic.Markdown/DocumentationGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ private bool CompilationNotNeeded(GenerationState? generationState, out HashSet<
outputSeenChanges = generationState?.LastSeenChanges ?? DateTimeOffset.MinValue;
if (generationState == null)
return false;
if (Context.Force)
{
_logger.LogInformation($"Full compilation: --force was specified");
return false;
}

if (Context.Git != generationState.Git)
{
Expand All @@ -144,7 +149,6 @@ private bool CompilationNotNeeded(GenerationState? generationState, out HashSet<
_logger.LogInformation($"Incremental compilation. since: {generationState.LastSeenChanges}");
else if (DocumentationSet.LastWrite <= outputSeenChanges)
{
_logger.LogInformation($"No compilation: no changes since last observed: {generationState.LastSeenChanges}");
_logger.LogInformation($"No compilation: no changes since last observed: {generationState.LastSeenChanges} "
+ "Pass --force to force a full regeneration");
return true;
Expand All @@ -157,6 +161,7 @@ private async Task GenerateLinkReference(Cancel ctx)
{
var file = DocumentationSet.LinkReferenceFile;
var state = LinkReference.Create(DocumentationSet);

var bytes = JsonSerializer.SerializeToUtf8Bytes(state, SourceGenerationContext.Default.LinkReference);
await DocumentationSet.OutputPath.FileSystem.File.WriteAllBytesAsync(file.FullName, bytes, ctx);
}
Expand Down

0 comments on commit ac5b499

Please sign in to comment.