Skip to content

Commit

Permalink
(chocolatey#62) Use DefaultPushSource if set
Browse files Browse the repository at this point in the history
If the DefaultPushSource config value is not empty, use it as the
default source which to push packages. Using --source will override
it. It overrides the built-in default of using the
"ChocolateyCommunityFeedPushSource".

If --api-key is not passed and a api key has not been saved for the
DefaultPushSource, it will fail with the standard message about an api
key being required.
  • Loading branch information
TheCakeIsNaOH committed Oct 29, 2021
1 parent 10f54d2 commit 4761537
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public virtual void handle_additional_argument_parsing(IList<string> unparsedArg
{
configuration.Input = string.Join(" ", unparsedArguments); // path to .nupkg - assume relative

if (string.IsNullOrWhiteSpace(configuration.Sources) && !string.IsNullOrWhiteSpace(configuration.PushCommand.DefaultSource))
{
configuration.Sources = configuration.PushCommand.DefaultSource;
}

if (string.IsNullOrWhiteSpace(configuration.Sources))
{
configuration.Sources = ApplicationParameters.ChocolateyCommunityFeedPushSource;
Expand Down

0 comments on commit 4761537

Please sign in to comment.