Skip to content

Commit b8e0231

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 a97dc30 commit b8e0231

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
@@ -1702,6 +1702,8 @@ protected virtual ChocolateyConfiguration SetConfigFromRememberedArguments(Choco
17021702
ConfigurationOptions.OptionSet.Parse(packageArguments);
17031703

17041704
// there may be overrides from the user running upgrade
1705+
if (!string.IsNullOrWhiteSpace(originalConfig.PackageParameters)) config.PackageParameters = originalConfig.PackageParameters;
1706+
if (!string.IsNullOrWhiteSpace(originalConfig.InstallArguments)) config.InstallArguments = originalConfig.InstallArguments;
17051707
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Username)) config.SourceCommand.Username = originalConfig.SourceCommand.Username;
17061708
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Password)) config.SourceCommand.Password = originalConfig.SourceCommand.Password;
17071709
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Certificate)) config.SourceCommand.Certificate = originalConfig.SourceCommand.Certificate;

0 commit comments

Comments
 (0)