mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +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
|
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(
|
var downloadDotNetInstallSh = BuildScript.DownloadFile(
|
||||||
"https://dot.net/v1/dotnet-install.sh",
|
"https://dot.net/v1/dotnet-install.sh",
|
||||||
"dotnet-install.sh",
|
dotnetInstallPath,
|
||||||
e => builder.Log(Severity.Warning, $"Failed to download 'dotnet-install.sh': {e.Message}"));
|
e => builder.Log(Severity.Warning, $"Failed to download 'dotnet-install.sh': {e.Message}"));
|
||||||
|
|
||||||
var chmod = new CommandBuilder(builder.Actions).
|
var chmod = new CommandBuilder(builder.Actions).
|
||||||
RunCommand("chmod").
|
RunCommand("chmod").
|
||||||
Argument("u+x").
|
Argument("u+x").
|
||||||
Argument("dotnet-install.sh");
|
Argument(dotnetInstallPath);
|
||||||
|
|
||||||
var install = new CommandBuilder(builder.Actions).
|
var install = new CommandBuilder(builder.Actions).
|
||||||
RunCommand("./dotnet-install.sh").
|
RunCommand(dotnetInstallPath).
|
||||||
Argument("--channel").
|
Argument("--channel").
|
||||||
Argument("release").
|
Argument("release").
|
||||||
Argument("--version").
|
Argument("--version").
|
||||||
@@ -211,7 +213,7 @@ namespace Semmle.Autobuild.CSharp
|
|||||||
|
|
||||||
var removeScript = new CommandBuilder(builder.Actions).
|
var removeScript = new CommandBuilder(builder.Actions).
|
||||||
RunCommand("rm").
|
RunCommand("rm").
|
||||||
Argument("dotnet-install.sh");
|
Argument(dotnetInstallPath);
|
||||||
|
|
||||||
return downloadDotNetInstallSh & chmod.Script & install.Script & BuildScript.Try(removeScript.Script);
|
return downloadDotNetInstallSh & chmod.Script & install.Script & BuildScript.Try(removeScript.Script);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user