Skip to content

Commit 6848a8d

Browse files
committed
(#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 4dae78a commit 6848a8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ protected virtual ChocolateyConfiguration SetConfigFromRememberedArguments(Choco
16181618
ConfigurationOptions.OptionSet.Parse(packageArguments);
16191619

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

0 commit comments

Comments
 (0)