mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: Download dotnet-install.sh to the scratch dir
This commit is contained in:
@@ -190,18 +190,20 @@ namespace Semmle.Autobuild.CSharp
|
||||
}
|
||||
else
|
||||
{
|
||||
var dotnetInstallPath = builder.Actions.PathCombine(FileUtils.GetTemporaryWorkingDirectory(builder.Actions.GetEnvironmentVariable, builder.Options.Language.UpperCaseName, out var _), ".dotnet", "dotnet-install.sh");
|
||||
|
||||
var downloadDotNetInstallSh = BuildScript.DownloadFile(
|
||||
"https://dot.net/v1/dotnet-install.sh",
|
||||
"dotnet-install.sh",
|
||||
dotnetInstallPath,
|
||||
e => builder.Log(Severity.Warning, $"Failed to download 'dotnet-install.sh': {e.Message}"));
|
||||
|
||||
var chmod = new CommandBuilder(builder.Actions).
|
||||
RunCommand("chmod").
|
||||
Argument("u+x").
|
||||
Argument("dotnet-install.sh");
|
||||
Argument(dotnetInstallPath);
|
||||
|
||||
var install = new CommandBuilder(builder.Actions).
|
||||
RunCommand("./dotnet-install.sh").
|
||||
RunCommand(dotnetInstallPath).
|
||||
Argument("--channel").
|
||||
Argument("release").
|
||||
Argument("--version").
|
||||
@@ -211,7 +213,7 @@ namespace Semmle.Autobuild.CSharp
|
||||
|
||||
var removeScript = new CommandBuilder(builder.Actions).
|
||||
RunCommand("rm").
|
||||
Argument("dotnet-install.sh");
|
||||
Argument(dotnetInstallPath);
|
||||
|
||||
return downloadDotNetInstallSh & chmod.Script & install.Script & BuildScript.Try(removeScript.Script);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user