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 Dec 22, 2022
1 parent 4befa56 commit 3df6b2a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,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 3df6b2a

Please sign in to comment.