8000 Improved support for local NuGet.Config files. by seesharper · Pull Request #466 · dotnet-script/dotnet-script · GitHub
[go: up one dir, main page]

Skip to content

Improved support for local NuGet.Config files. #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 20, 2019
Merged

Improved support for local NuGet.Config files. #466

merged 5 commits into from
Jun 20, 2019

Conversation

seesharper
Copy link
Collaborator

This PR adds support for a better handling of NuGet.Configfiles and fixes #463 .

We used to make an attempt to resolve the various NuGet elements/tags from a given script folder.
This had the drawback of expanding environment variables that could contains sensitive information such as repository credentials.

As it turned out, dotnet restore has a --configfile argument that lets us pass the path to the NuGet.Config file. This file may not be in the script folder, but it can also be in a parent folder relative to the script folder. So we use Settings.GetConfigFilePaths (NuGet.ProjectModel) for this.

The first in this list is the "nearest" config file seen from the script folder.

https://github.com/NuGet/NuGet.Client/blob/9dac90978fe16f0b097b4b4b910ffb8dfdc059b6/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L583

Also some general housekeeping like excluding the test scripts from OmniSharp which improves the experience when working with dotnet-script in OmniSharp/VS Code.

@seesharper seesharper requested a review from filipw June 19, 2019 21:47
Copy link
Member
@filipw filipw left a comment

Choose a reason for hiding this comment

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

excellent, that's how it should have been done from the beginning 👏

@filipw filipw merged commit 139ba2f into master Jun 20, 2019
@filipw filipw deleted the bugfix/nuget branch June 20, 2019 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Passed config file is modified and becomes invalid
2 participants
0