You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(#2886) Switch remembered args to only change local configuration
This renames set_package_config_for_upgrade to
get_package_config_from_remembered_args and changes how it operates.
First, a option set is set up, so only the config that is passed in is
modified, instead of the config that the global options parser was set
with with.
Second, it returns the modified configuration instead of the original
configuration, because it is the local configuration being modified.
Third, it renames the function and changes log messages to be more
general, so it later can more easily be reused for uninstall and export.
This change fixes remembered arguments when Chocolatey is used as a
library, like in ChocolateyGUI, where the config that is passed to
the install_run method is not necessarily the same config object that
was used to set up the global argument parser.
The downside of using a new commandline parser is that it opens up the
possibility of drift between the upgrade/global arguments and this
added parser. However, this is not an issue because the format of the
saved arguments is known, and any added arguments there would not work
without being added here as well, which would be picked up during
development.
this.Log().Debug(ChocolateyLoggers.Verbose,"{0} - Adding '{1}' to upgrade arguments. Values not shown due to detected sensitive arguments".FormatWith(packageInfo.Package.Id,optionName.EscapeCurlyBraces()));
1612
+
this.Log().Debug(ChocolateyLoggers.Verbose,"{0} - Adding '{1}' to arguments. Values not shown due to detected sensitive arguments".FormatWith(packageInfo.Package.Id,optionName.EscapeCurlyBraces()));
"CommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the configuration of {0} seconds. '0' for infinite starting in 0.10.4.".format_with(config.CommandExecutionTimeoutSeconds.to_string()),
"UseSystemPowerShell - Execute PowerShell using an external process instead of the built-in PowerShell host. Should only be used when internal host is failing. Available in 0.9.10+.",
0 commit comments