diff --git a/ChangeLog.md b/ChangeLog.md index de9da09a6a..8b0456ba06 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix ([RCS1223](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1223.md)) ([#1051](https://github.com/JosefPihrt/Roslynator/pull/1051)). - Do not remove braces in the cases where there are overlapping local variables. ([RCS1031](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1013.md), [RCS1211](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1211.md), [RCS1208](https://github.com/JosefPihrt/Roslynator/blob/main/docs/analyzers/RCS1208.md)) ([#1039](https://github.com/JosefPihrt/Roslynator/pull/1039)). - [CLI] Analyze command does not create the XML output file and returns incorrect exit code when only compiler diagnostics are reported ([#1056](https://github.com/JosefPihrt/Roslynator/pull/1056) by @PeterKaszab). +- [CLI] Fix exit code when multiple projects are processed ([#1061](https://github.com/JosefPihrt/Roslynator/pull/1061) by @PeterKaszab). ## [4.2.0] - 2022-11-27 diff --git a/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs b/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs index 4c6eb3b6f2..7080e2c6e3 100644 --- a/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs +++ b/src/CommandLine/Commands/MSBuildWorkspaceCommand.cs @@ -61,7 +61,7 @@ public async Task ExecuteAsync(IEnumerable paths, string try { - var status = CommandStatus.NotSuccess; + var status = CommandStatus.Success; var results = new List(); foreach (string path in paths) @@ -81,11 +81,8 @@ public async Task ExecuteAsync(IEnumerable paths, string results.Add(result); - if (status != CommandStatus.Fail - && result.Status != CommandStatus.NotSuccess) - { + if (status == CommandStatus.Success) status = result.Status; - } if (status == CommandStatus.Canceled) break;