Skip to content

Commit

Permalink
Fix Add-EnvPATH on self-hosted Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 21, 2022
1 parent 7205f47 commit 808396c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,13 @@ Function Add-EnvPATH {
if(-not(Test-Path $EnvPATH)) {
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.
Expand Down

0 comments on commit 808396c

Please sign in to comment.