[macOS] Add GOROOT env variables (#4220)

This commit is contained in:
Nikita Bykov
2021-10-14 14:42:34 +03:00
committed by GitHub
parent 3ec2449ade
commit 64937b9944
13 changed files with 155 additions and 18 deletions
+14 -3
View File
@@ -104,8 +104,7 @@ function Invoke-ValidateCommand {
return $output
}
function Start-DownloadWithRetry
{
function Start-DownloadWithRetry {
Param
(
[Parameter(Mandatory)]
@@ -147,4 +146,16 @@ function Start-DownloadWithRetry
}
return $filePath
}
}
function Add-EnvironmentVariable {
param
(
[Parameter(Mandatory)] [string] $Name,
[Parameter(Mandatory)] [string] $Value,
[string] $FilePath = "${env:HOME}/.bashrc"
)
$envVar = "export {0}={1}" -f $Name, $Value
Add-Content -Path $FilePath -Value $envVar
}