Skip to content

Commit

Permalink
(chocolatey#62) Add new config value DefaultPushSource
Browse files Browse the repository at this point in the history
This config value will be used to set the default source used for
choco push. The default value will be overridden if the user specifies
--source. The value goes into config.PushCommand.DefaultSource
  • Loading branch information
TheCakeIsNaOH authored and vexx32 committed Mar 17, 2023
1 parent 89844cf commit b24a6c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/chocolatey/infrastructure.app/ApplicationParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public static class ConfigSettings
public static readonly string WebRequestTimeoutSeconds = "webRequestTimeoutSeconds";
public static readonly string UpgradeAllExceptions = "upgradeAllExceptions";
public static readonly string DefaultTemplateName = "defaultTemplateName";
public static readonly string DefaultPushSource = "defaultPushSource";
}

public static class Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ private static void set_config_items(ChocolateyConfiguration config, ConfigFileS
config.Proxy.BypassOnLocal = set_config_item(ApplicationParameters.ConfigSettings.ProxyBypassOnLocal, configFileSettings, "true", "Bypass proxy for local connections. Available in 0.10.4+.").is_equal_to(bool.TrueString);
config.UpgradeCommand.PackageNamesToSkip = set_config_item(ApplicationParameters.ConfigSettings.UpgradeAllExceptions, configFileSettings, string.Empty, "A comma-separated list of package names that should not be upgraded when running `choco upgrade all'. Defaults to empty. Available in 0.10.14+.");
config.DefaultTemplateName = set_config_item(ApplicationParameters.ConfigSettings.DefaultTemplateName, configFileSettings, string.Empty, "Default template name used when running 'choco new' command. Available in 0.12.0+.");
config.PushCommand.DefaultSource = set_config_item(ApplicationParameters.ConfigSettings.DefaultPushSource, configFileSettings, string.Empty, "Default source to push packages to when running 'choco push' command. Available in 0.12.0 +.");
}

private static string set_config_item(string configName, ConfigFileSettings configFileSettings, string defaultValue, string description, bool forceSettingValue = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,7 @@ public PackCommandConfiguration()
public sealed class PushCommandConfiguration
{
public string Key { get; set; }
public string DefaultSource { get; set; }
//DisableBuffering?
}

Expand Down

0 comments on commit b24a6c7

Please sign in to comment.