Skip to content

Commit 6a77751

Browse files
committed
C#: Add -L flag to autobuilder curl invocation
Turns out that `https://dot.net/v1/dotnet-install.sh` has moved to `https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh`. Instead of updating the URL in the code, I prefer to keep the old URL (which is still referenced in the documentation), and let `curl` handle the redirect.
1 parent 6e6dab9 commit 6a77751

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

csharp/autobuilder/Semmle.Autobuild.Tests/BuildScripts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ public void TestDotnetVersionNotInstalled()
902902
{
903903
Actions.RunProcess["dotnet --list-sdks"] = 0;
904904
Actions.RunProcessOut["dotnet --list-sdks"] = "2.1.2 [C:\\Program Files\\dotnet\\sdks]\n2.1.4 [C:\\Program Files\\dotnet\\sdks]";
905-
Actions.RunProcess[@"curl -sO https://dot.net/v1/dotnet-install.sh"] = 0;
905+
Actions.RunProcess[@"curl -L -sO https://dot.net/v1/dotnet-install.sh"] = 0;
906906
Actions.RunProcess[@"chmod u+x dotnet-install.sh"] = 0;
907907
Actions.RunProcess[@"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet"] = 0;
908908
Actions.RunProcess[@"rm dotnet-install.sh"] = 0;
@@ -938,7 +938,7 @@ public void TestDotnetVersionAlreadyInstalled()
938938
{
939939
Actions.RunProcess["dotnet --list-sdks"] = 0;
940940
Actions.RunProcessOut["dotnet --list-sdks"] = "2.1.3 [C:\\Program Files\\dotnet\\sdks]\n2.1.4 [C:\\Program Files\\dotnet\\sdks]";
941-
Actions.RunProcess[@"curl -sO https://dot.net/v1/dotnet-install.sh"] = 0;
941+
Actions.RunProcess[@"curl -L -sO https://dot.net/v1/dotnet-install.sh"] = 0;
942942
Actions.RunProcess[@"chmod u+x dotnet-install.sh"] = 0;
943943
Actions.RunProcess[@"./dotnet-install.sh --channel release --version 2.1.3 --install-dir C:\Project/.dotnet"] = 0;
944944
Actions.RunProcess[@"rm dotnet-install.sh"] = 0;

csharp/autobuilder/Semmle.Autobuild/DotNetRule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public bool CheckValidationResult(ServicePoint srvPoint, X509Certificate certifi
196196
{
197197
var curl = new CommandBuilder(builder.Actions).
198198
RunCommand("curl").
199+
Argument("-L").
199200
Argument("-sO").
200201
Argument("https://dot.net/v1/dotnet-install.sh");
201202

0 commit comments

Comments
 (0)