Skip to content

Commit

Permalink
(GH-1069) Fix - Disable failOnInvalidOrMissingLicense Feature
Browse files Browse the repository at this point in the history
Once enabled, if one does not have a license, they cannot run choco feature
to disable the feature and cannot use Chocolatey until one manually changes
the feature in the configuration file.

This change disables the check for a license when
`failOnInvalidOrMissingLicense` is enabled and the 'features' command is
being used.
  • Loading branch information
wilson208 authored and ferventcoder committed Jan 21, 2017
1 parent 366a9fb commit 1cf2e19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chocolatey/infrastructure.app/runners/GenericRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ private void set_source_type(ChocolateyConfiguration config)

public void fail_when_license_is_missing_or_invalid_if_requested(ChocolateyConfiguration config)
{
if (!config.Features.FailOnInvalidOrMissingLicense) return;
if (!config.Features.FailOnInvalidOrMissingLicense ||
config.CommandName.trim_safe().is_equal_to("feature") ||
config.CommandName.trim_safe().is_equal_to("features")
) return;

if (!config.Information.IsLicensedVersion) throw new ApplicationException("License is missing or invalid.");
}
Expand Down

0 comments on commit 1cf2e19

Please sign in to comment.