C#: Allow specifying package feeds for dotnet restore as command line arguments

This commit is contained in:
Michael B. Gale
2025-01-07 11:41:04 +00:00
parent 11efb55aa1
commit 726123c0cb
2 changed files with 11 additions and 1 deletions

View File

@@ -67,6 +67,16 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
args += $" --configfile \"{restoreSettings.PathToNugetConfig}\"";
}
// Add package sources. If any are present, they override all sources specified in
// the configuration file(s).
if (restoreSettings.Sources != null)
{
foreach (string source in restoreSettings.Sources)
{
args += $" -s {source}";
}
}
if (restoreSettings.ForceReevaluation)
{
args += " --force";