Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

Commit

Permalink
Fix variable detection on linux
Browse files Browse the repository at this point in the history
Linux can have empty values for environment variables. Windows evidently doesn't tend to have those.
  • Loading branch information
AArnott committed Oct 20, 2022
1 parent 2eaf0fb commit abab1d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azure-pipelines/variables/_pipelines.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ param (
(& "$PSScriptRoot\_all.ps1").GetEnumerator() |% {
# Always use ALL CAPS for env var names since Azure Pipelines converts variable names to all caps and on non-Windows OS, env vars are case sensitive.
$keyCaps = $_.Key.ToUpper()
if (Test-Path -Path "env:$keyCaps") {
if ((Test-Path "env:$keyCaps") -and (Get-Content "env:$keyCaps")) {
Write-Host "Skipping setting $keyCaps because variable is already set to '$(Get-Content env:$keyCaps)'." -ForegroundColor Cyan
} else {
Write-Host "$keyCaps=$($_.Value)" -ForegroundColor Yellow
Expand Down

0 comments on commit abab1d8

Please sign in to comment.