Fix Add-EnvPATH on self-hosted Windows
This commit is contained in:
parent
7205f47330
commit
808396c4e6
1 changed files with 6 additions and 4 deletions
|
|
@ -118,11 +118,13 @@ Function Add-EnvPATH {
|
||||||
if(-not(Test-Path $EnvPATH)) {
|
if(-not(Test-Path $EnvPATH)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
$env_file = $current_profile
|
$env_file = $env:GITHUB_ENV
|
||||||
if ($env:GITHUB_ENV) {
|
$env_data = Get-Content -Path $EnvPATH
|
||||||
$env_file = $env:GITHUB_ENV
|
if (-not($env:GITHUB_ENV)) {
|
||||||
|
$env_file = $current_profile
|
||||||
|
$env_data = $env_data | ForEach-Object { '$env:' + $_ }
|
||||||
}
|
}
|
||||||
Get-Content -Path $EnvPATH | Add-Content -Path $env_file -Encoding utf8
|
$env_data | Add-Content -Path $env_file -Encoding utf8
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to make sure printf is in PATH.
|
# Function to make sure printf is in PATH.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue