Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Source config implementation #101

Closed
wants to merge 2 commits into from

Conversation

LucidSage
Copy link
Contributor

I have removed the source argument defaults used in all the functions.
I have added a new Get-SourceArgument function to wrap the logic for handling the source argument generation.
This new function is then used in Chocolatey-List, Chocolatey-Version, and Run-Get functions.

Basic logic used in Get-SourceArgument:

  • if the user supplied a source, use it
  • if the useNuGetForSources flag is true, do not set the source argument, which will let NuGet handle it.
  • otherwise read the sources out of the chocolatey.config file and use those.

@@ -5,9 +5,6 @@ param(
)

$srcArgs = "-source $source"
if ($source -like 'https://go.microsoft.com/fwlink/?LinkID=230477') {
$srcArgs = "-source http://chocolatey.org/"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need it to default to chocolatey as a source...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter defaults to chocolatey already:
[string] $source = 'http://chocolatey.org/'

Is this not sufficient? Just let me know if this needs to be backed out.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I didn't RTFM, just the line above... :D

@ferventcoder
Copy link
Contributor

It's so much cleaner than all of that stuff I was doing... :D

@ghost ghost assigned ferventcoder Jun 5, 2012
@LucidSage
Copy link
Contributor Author

Glad I can help. It was a good experience for me to get more familiar with git too. I appreciate it!

@ferventcoder
Copy link
Contributor

This is in. Thanks!

@LucidSage
Copy link
Contributor Author

Cool! Glad I could help :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants