mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Merge pull request #6270 from hvitved/csharp/standalone-nuget-restore
C#: Skip `dotnet restore` in standalone extraction when `nuget_restore: false` is set
This commit is contained in:
@@ -108,7 +108,10 @@ namespace Semmle.BuildAnalyser
|
||||
new[] { options.SolutionFile } :
|
||||
sourceDir.GetFiles("*.sln", SearchOption.AllDirectories).Select(d => d.FullName);
|
||||
|
||||
RestoreSolutions(solutions);
|
||||
if (options.UseNuGet)
|
||||
{
|
||||
RestoreSolutions(solutions);
|
||||
}
|
||||
dllDirNames.Add(packageDirectory.DirInfo.FullName);
|
||||
assemblyCache = new BuildAnalyser.AssemblyCache(dllDirNames, progress);
|
||||
AnalyseSolutions(solutions);
|
||||
@@ -324,7 +327,16 @@ namespace Semmle.BuildAnalyser
|
||||
|
||||
private void Restore(string projectOrSolution)
|
||||
{
|
||||
var exit = DotNet.RestoreToDirectory(projectOrSolution, packageDirectory.DirInfo.FullName);
|
||||
int exit;
|
||||
try
|
||||
{
|
||||
exit = DotNet.RestoreToDirectory(projectOrSolution, packageDirectory.DirInfo.FullName);
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
exit = 2;
|
||||
}
|
||||
|
||||
switch (exit)
|
||||
{
|
||||
case 0:
|
||||
|
||||
Reference in New Issue
Block a user