Skip to content

Commit

Permalink
[CLI] Fix exit code when multiple projects are processed (dotnet#1061)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterKaszab authored and JochemHarmes committed Oct 30, 2023
1 parent d0705d5 commit 4a87190
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 2 additions & 5 deletions src/CommandLine/Commands/MSBuildWorkspaceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public async Task<CommandStatus> ExecuteAsync(IEnumerable<string> paths, string

try
{
var status = CommandStatus.NotSuccess;
var status = CommandStatus.Success;
var results = new List<TCommandResult>();

foreach (string path in paths)
Expand All @@ -81,11 +81,8 @@ public async Task<CommandStatus> ExecuteAsync(IEnumerable<string> 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;
Expand Down

0 comments on commit 4a87190

Please sign in to comment.