Merge pull request #13687 from tamasvajk/standalone/nugetconfig

C#: Use `nuget.config` file for `dotnet restore` fallback logic
This commit is contained in:
Tamás Vajk
2023-07-07 15:53:07 +02:00
committed by GitHub
3 changed files with 37 additions and 9 deletions

View File

@@ -56,9 +56,11 @@ namespace Semmle.BuildAnalyser
return true;
}
public bool RestoreToDirectory(string projectOrSolutionFile, string packageDirectory)
public bool RestoreToDirectory(string projectOrSolutionFile, string packageDirectory, string? pathToNugetConfig = null)
{
var args = $"restore --no-dependencies \"{projectOrSolutionFile}\" --packages \"{packageDirectory}\" /p:DisableImplicitNuGetFallbackFolder=true";
if (pathToNugetConfig != null)
args += $" --configfile \"{pathToNugetConfig}\"";
return RunCommand(args);
}