mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +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
|
|
||||||
if ($env:GITHUB_ENV) {
|
|
||||||
$env_file = $env:GITHUB_ENV
|
$env_file = $env:GITHUB_ENV
|
||||||
|
$env_data = Get-Content -Path $EnvPATH
|
||||||
|
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