Skip to content

Commit

Permalink
Off by one error for exit status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Nov 20, 2024
1 parent 4855684 commit 7e8430a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public class DiagnosticsCollector(ILoggerFactory loggerFactory, IReadOnlyCollect

public DiagnosticsChannel Channel { get; } = new();

private long _errors;
private long _warnings;
public long Warnings => _warnings;
public long Errors => _errors;
private int _errors;
private int _warnings;
public int Warnings => _warnings;
public int Errors => _errors;

private Task? _started;

Expand Down
2 changes: 1 addition & 1 deletion src/docs-builder/Cli/Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public async Task<int> Generate(
var set = new DocumentationSet(context);
var generator = new DocumentationGenerator(set, logger);
await generator.GenerateAll(ctx);
return context.Collector.Errors > 1 ? 1 : 0;
return context.Collector.Errors + context.Collector.Warnings;
}

/// <summary>
Expand Down

0 comments on commit 7e8430a

Please sign in to comment.