From 48386b3a1f6b13d3ea28886753b49b50e758d0ab Mon Sep 17 00:00:00 2001 From: Daniel Palme Date: Sat, 24 Feb 2024 20:44:11 +0100 Subject: [PATCH] #653 Fixed command line parameter handling on Linux and MacOS --- src/Readme.txt | 1 + src/ReportGenerator.Core/Generator.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/Readme.txt b/src/Readme.txt index 203cf75a..69725008 100644 --- a/src/Readme.txt +++ b/src/Readme.txt @@ -70,6 +70,7 @@ CHANGELOG 5.2.2.0 * New: #651 Added setting to add custom prefix to generated history files + * Fix: #653 Fixed command line parameter handling on Linux and MacOS 5.2.1.0 diff --git a/src/ReportGenerator.Core/Generator.cs b/src/ReportGenerator.Core/Generator.cs index aeb72050..ed1f147d 100644 --- a/src/ReportGenerator.Core/Generator.cs +++ b/src/ReportGenerator.Core/Generator.cs @@ -153,6 +153,7 @@ public bool GenerateReport( Logger.Debug(Resources.Settings); Logger.Debug(" " + JsonSerializer.ToJsonString(settings)); + Logger.Debug(" " + JsonSerializer.ToJsonString(minimumCoverageThresholds)); Logger.Debug(" " + JsonSerializer.ToJsonString(riskHotspotsAnalysisThresholds)); var stopWatch = Stopwatch.StartNew(); @@ -345,6 +346,7 @@ private IConfigurationRoot GetConfiguration() var args = Environment.GetCommandLineArgs() .Where(a => !a.StartsWith("-property:")) .Where(a => !a.StartsWith("-p:")) + .Where(a => !(a.StartsWith("/") && a.EndsWith(".dll"))) // Filter path in arguments like /home/user/.dotnet/tools/.store/dotnet-reportgenerator-globaltool/x.y.z/dotnet-reportgenerator-globaltool/x.y.z/tools/net7.0/any/ReportGenerator.dll (appears in global tool) .Where(a => !CommandLineArgumentNames.CommandLineParameterRegex.IsMatch(a)) .ToArray();