Skip to content

Commit 32d4f89

Browse files
authored
#730 Added support for the REPORTGENERATOR_LICENSE environment variable in the MSBuild task
Added support for the REPORTGENERATOR_LICENSE environment variable in the MSBuild task
1 parent f735c31 commit 32d4f89

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/ReportGenerator.Core/ReportConfigurationBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public ReportConfiguration Create(Dictionary<string, string> cliArguments)
258258
title = value;
259259
}
260260

261-
string licenseFromEnviroment = Environment.GetEnvironmentVariable("REPORTGENERATOR_LICENSE");
261+
string licenseFromEnvironment = Environment.GetEnvironmentVariable("REPORTGENERATOR_LICENSE");
262262

263263
if (namedArguments.TryGetValue(CommandLineArgumentNames.License, out value))
264264
{
@@ -268,9 +268,9 @@ public ReportConfiguration Create(Dictionary<string, string> cliArguments)
268268
{
269269
license = value;
270270
}
271-
else if (licenseFromEnviroment != null)
271+
else if (licenseFromEnvironment != null)
272272
{
273-
license = licenseFromEnviroment;
273+
license = licenseFromEnvironment;
274274
}
275275

276276
return new ReportConfiguration(

src/ReportGenerator.MSBuild/ReportGenerator.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,18 @@ public override bool Execute()
384384
title = value;
385385
}
386386

387-
if (string.IsNullOrEmpty(license) &&
388-
config.TryGetString(DotNetConfigSettingNames.License, out value))
389-
{
390-
license = value;
387+
if (string.IsNullOrEmpty(license))
388+
{
389+
string licenseFromEnvironment = Environment.GetEnvironmentVariable("REPORTGENERATOR_LICENSE");
390+
391+
if (config.TryGetString(DotNetConfigSettingNames.License, out value))
392+
{
393+
license = value;
394+
}
395+
else if (licenseFromEnvironment != null)
396+
{
397+
license = licenseFromEnvironment;
398+
}
391399
}
392400

393401
var configuration = new ReportConfiguration(

0 commit comments

Comments
 (0)