mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Check fallback nuget feeds before trying to use them in the fallback restore process
This commit is contained in:
@@ -95,9 +95,9 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
|
||||
public IList<string> GetListedSdks() => GetResultList("--list-sdks");
|
||||
|
||||
private IList<string> GetResultList(string args)
|
||||
private IList<string> GetResultList(string args, string? workingDirectory = null)
|
||||
{
|
||||
if (dotnetCliInvoker.RunCommand(args, out var results))
|
||||
if (dotnetCliInvoker.RunCommand(args, workingDirectory, out var results))
|
||||
{
|
||||
return results;
|
||||
}
|
||||
@@ -111,7 +111,11 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
||||
return dotnetCliInvoker.RunCommand(args);
|
||||
}
|
||||
|
||||
public IList<string> GetNugetFeeds(string nugetConfig) => GetResultList($"nuget list source --format Short --configfile \"{nugetConfig}\"");
|
||||
private const string nugetListSourceCommand = "nuget list source --format Short";
|
||||
|
||||
public IList<string> GetNugetFeeds(string nugetConfig) => GetResultList($"{nugetListSourceCommand} --configfile \"{nugetConfig}\"");
|
||||
|
||||
public IList<string> GetNugetFeedsFromFolder(string folderPath) => GetResultList(nugetListSourceCommand, folderPath);
|
||||
|
||||
// The version number should be kept in sync with the version .NET version used for building the application.
|
||||
public const string LatestDotNetSdkVersion = "8.0.101";
|
||||
|
||||
Reference in New Issue
Block a user