mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix Add-EnvPATH on self-hosted Windows
This commit is contained in:
parent
7205f47330
commit
808396c4e6
@ -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 New Issue
Block a user