Skip to content

Commit 6c31592

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 712d65a commit 6c31592

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
@@ -1524,6 +1524,8 @@ protected virtual ChocolateyConfiguration set_package_config_for_upgrade(Chocola
15241524
ConfigurationOptions.OptionSet.Parse(packageArguments);
15251525

15261526
// there may be overrides from the user running upgrade
1527+
if (!string.IsNullOrWhiteSpace(originalConfig.PackageParameters)) config.PackageParameters = originalConfig.PackageParameters;
1528+
if (!string.IsNullOrWhiteSpace(originalConfig.InstallArguments)) config.InstallArguments = originalConfig.InstallArguments;
15271529
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Username)) config.SourceCommand.Username = originalConfig.SourceCommand.Username;
15281530
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Password)) config.SourceCommand.Password = originalConfig.SourceCommand.Password;
15291531
if (!string.IsNullOrWhiteSpace(originalConfig.SourceCommand.Certificate)) config.SourceCommand.Certificate = originalConfig.SourceCommand.Certificate;

0 commit comments

Comments
 (0)