From 38660a0db633d18a901e1530939f720070159ef8 Mon Sep 17 00:00:00 2001 From: Tamas Vajk Date: Wed, 5 Jun 2024 10:30:16 +0200 Subject: [PATCH] Adjust exit code for binlog extraction --- .../Semmle.Extraction.CSharp/Extractor/Extractor.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs index 8eb16cb6e46a..610d8065711a 100644 --- a/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs +++ b/csharp/extractor/Semmle.Extraction.CSharp/Extractor/Extractor.cs @@ -120,7 +120,7 @@ public static ExitCode Run(string[] args) }; var compilerCalls = BinaryLogUtil.ReadAllCompilerCalls(fileStream, predicate); - var exitCode = ExitCode.Ok; + var allFailed = true; foreach (var compilerCall in compilerCalls) { var diagnosticName = compilerCall.GetDiagnosticName(); @@ -130,13 +130,13 @@ public static ExitCode Run(string[] args) compilerCallOptions.CompilerArguments.AddRange(compilerCall.GetArguments()); logger.LogInfo($"Running extractor on arguments from binary log. Processing {diagnosticName}."); var ec = Run(compilerCallOptions, logger); - if (ec != ExitCode.Ok) + if (ec != ExitCode.Failed) { - exitCode = ec; + allFailed &= false; } } - return exitCode; + return allFailed ? ExitCode.Failed : ExitCode.Ok; } else {