зеркало из https://github.com/github/codeql.git
C#: Initialise `DependabotProxy` in `DotNetCliInvoker`
This commit is contained in:
Родитель
f346e38058
Коммит
b1828a8dc0
|
@ -27,7 +27,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||
Info();
|
||||
}
|
||||
|
||||
private DotNet(ILogger logger, string? dotNetPath, TemporaryDirectory tempWorkingDirectory) : this(new DotNetCliInvoker(logger, Path.Combine(dotNetPath ?? string.Empty, "dotnet")), logger, tempWorkingDirectory) { }
|
||||
private DotNet(ILogger logger, string? dotNetPath, TemporaryDirectory tempWorkingDirectory) : this(new DotNetCliInvoker(logger, Path.Combine(dotNetPath ?? string.Empty, "dotnet"), tempWorkingDirectory), logger, tempWorkingDirectory) { }
|
||||
|
||||
internal static IDotNet Make(IDotNetCliInvoker dotnetCliInvoker, ILogger logger) => new DotNet(dotnetCliInvoker, logger);
|
||||
|
||||
|
|
|
@ -12,12 +12,14 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||
internal sealed class DotNetCliInvoker : IDotNetCliInvoker
|
||||
{
|
||||
private readonly ILogger logger;
|
||||
private readonly DependabotProxy proxy;
|
||||
|
||||
public string Exec { get; }
|
||||
|
||||
public DotNetCliInvoker(ILogger logger, string exec)
|
||||
public DotNetCliInvoker(ILogger logger, string exec, TemporaryDirectory tempWorkingDirectory)
|
||||
{
|
||||
this.logger = logger;
|
||||
this.proxy = new DependabotProxy(tempWorkingDirectory);
|
||||
this.Exec = exec;
|
||||
logger.LogInfo($"Using .NET CLI executable: '{Exec}'");
|
||||
}
|
||||
|
@ -38,6 +40,14 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
|
|||
startInfo.EnvironmentVariables["DOTNET_CLI_UI_LANGUAGE"] = "en";
|
||||
startInfo.EnvironmentVariables["MSBUILDDISABLENODEREUSE"] = "1";
|
||||
startInfo.EnvironmentVariables["DOTNET_SKIP_FIRST_TIME_EXPERIENCE"] = "true";
|
||||
|
||||
// Configure the proxy settings, if applicable.
|
||||
this.proxy.ApplyProxy(this.logger, startInfo);
|
||||
|
||||
this.logger.LogInfo(startInfo.EnvironmentVariables["HTTP_PROXY"] ?? "");
|
||||
this.logger.LogInfo(startInfo.EnvironmentVariables["HTTPS_PROXY"] ?? "");
|
||||
this.logger.LogInfo(startInfo.EnvironmentVariables["SSL_CERT_FILE"] ?? "");
|
||||
|
||||
return startInfo;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче