Create ToolchainDir if does not exist (#25693)

This commit is contained in:
Justinas Stankevičius
2023-05-08 09:10:37 +00:00
committed by GitHub
parent 6c34f616bb
commit b1fd50f67e
+2
View File
@@ -89,6 +89,7 @@ function Install-Go {
[string] $GoVersion
)
begin {
New-Item -Path "$ToolchainDir" -ItemType Directory -Force | Out-Null
$GoDownloadUrl = "https://go.dev/dl/go$GoVersion.windows-amd64.zip"
$GoInstallZip = "$ToolchainDir/go$GoVersion.windows-amd64.zip"
Invoke-WebRequest -Uri $GoDownloadUrl -OutFile $GoInstallZip
@@ -124,6 +125,7 @@ function Install-Node {
[string] $NodeVersion
)
begin {
New-Item -Path "$ToolchainDir" -ItemType Directory -Force | Out-Null
$NodeZipfile = "$ToolchainDir/node-$NodeVersion-win-x64.zip"
Invoke-WebRequest -Uri https://nodejs.org/download/release/v$NodeVersion/node-v$NodeVersion-win-x64.zip -OutFile $NodeZipfile
Expand-Archive -Path $NodeZipfile -DestinationPath $ToolchainDir