Skip to content

Commit

Permalink
#674: License can now be supplied via the REPORTGENERATOR_LICENSE env…
Browse files Browse the repository at this point in the history
…ironment variable
  • Loading branch information
danielpalme committed May 28, 2024
1 parent f42c5be commit 2b62fbc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ For further details take a look at LICENSE.txt.

CHANGELOG

5.3.5.0

* New: #674: License can now be supplied via the REPORTGENERATOR_LICENSE environment variable

5.3.4.0

* New: #664: Added filter options for risk hotspots: '-riskhotspotassemblyfilters:', '-riskhotspotclassfilters:'
Expand Down
6 changes: 6 additions & 0 deletions src/ReportGenerator.Core/ReportConfigurationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ public ReportConfiguration Create(Dictionary<string, string> cliArguments)
title = value;
}

string licenseFromEnviroment = Environment.GetEnvironmentVariable("REPORTGENERATOR_LICENSE");

if (namedArguments.TryGetValue(CommandLineArgumentNames.License, out value))
{
license = value;
Expand All @@ -260,6 +262,10 @@ public ReportConfiguration Create(Dictionary<string, string> cliArguments)
{
license = value;
}
else if (licenseFromEnviroment != null)
{
license = licenseFromEnviroment;
}

return new ReportConfiguration(
reportFilePatterns,
Expand Down

0 comments on commit 2b62fbc

Please sign in to comment.