From 7e8430a25710ebef8122b6a55fa5fd53dccefab6 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Wed, 20 Nov 2024 21:05:57 +0100 Subject: [PATCH] Off by one error for exit status code --- src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs | 8 ++++---- src/docs-builder/Cli/Commands.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs b/src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs index 9a01560..a698c70 100644 --- a/src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs +++ b/src/Elastic.Markdown/Diagnostics/DiagnosticsChannel.cs @@ -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; diff --git a/src/docs-builder/Cli/Commands.cs b/src/docs-builder/Cli/Commands.cs index 1ad119d..35eef9f 100644 --- a/src/docs-builder/Cli/Commands.cs +++ b/src/docs-builder/Cli/Commands.cs @@ -60,7 +60,7 @@ public async Task 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; } ///