Skip to content

FSharp.DependencyManager.Nuget ignoring sources #16071

Description

@kevmal

If a nuget source has name with a space in it then it's skipped. Looks like the regex assumes no spaces:

if success then
// String returned by `dotnet nuget list source --format detailed` is formatted similar to:
// Registered Sources:
// 1. dotnet-eng [Enabled]
// https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json
// 2. dotnet-tools [Enabled]
// https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
// 3. dotnet5 [Enabled]
// https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json
// Use enabled feeds only (see NuGet.Commands.ListSourceRunner.Run) and strip off the flags.
let pattern =
@"(\s*\d+\.+\s*)(?'name'\S*)(\s*)\[(?'enabled'Enabled|Disabled)\](\s*)$(\s*)(?'uri'\S*)"
let regex =
new Regex(pattern, RegexOptions.Multiline ||| RegexOptions.ExplicitCapture)
let sourcelist = String.concat Environment.NewLine stdOut
String.concat
Environment.NewLine
[|
for m in regex.Matches(sourcelist) do
let name = m.Groups["name"].Value
let enabled = m.Groups["enabled"].Value
let uri = m.Groups["uri"].Value
if enabled.Length > 0 && enabled[0] = 'E' then
$""" <add key="{name}" value="{uri}" />"""
|]
else
""

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area-FSIBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions