Skip to content

Commit 6630a2f

Browse files
committed
(chocolatey#2761) Allow overriding remembered params and args
This allows overriding of remembered package parameters and install arguments during upgrade. So a user can pass in different package parameters or arguments without having to completely reinstall the package or turn of remembered arguments. At this point in the remembered arguments, the CacheLocation and CommandExecutionTimeout are already set even if not passed in explicitly, so there is no way to check if they are being overridden by the user. And the switch also cannot be checked, because the lack of a switch normally would mean that they are just relying on the remembered args to remember it.
1 parent 836b81d commit 6630a2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/chocolatey/infrastructure.app/services/NugetService.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1619,6 +1619,8 @@ protected virtual ChocolateyConfiguration SetConfigFromRememberedArguments(Choco
16191619
ConfigurationOptions.OptionSet.Parse(packageArguments);
16201620

16211621
// there may be overrides from the user running upgrade
1622+
if (!string.IsNullOrWhiteSpace(originalConfig.PackageParameters)) config.PackageParameters = originalConfig.PackageParameters;
1623+
if (!string.IsNullOrWhiteSpace(originalConfig.InstallArguments)) config.InstallArguments = originalConfig.InstallArguments;
16221624
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Username)) config.SourceCommand.Username = originalConfig.SourceCommand.Username;
16231625
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Password)) config.SourceCommand.Password = originalConfig.SourceCommand.Password;
16241626
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Certificate)) config.SourceCommand.Certificate = originalConfig.SourceCommand.Certificate;

0 commit comments

Comments
 (0)