Skip to content

Commit

Permalink
Skip instances where $file is an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek authored and azure-sdk committed Jul 3, 2024
1 parent 0afe4f9 commit e98c997
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions eng/common/TestResources/build-test-resource-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,16 @@ steps:
if ($subConfigFilesRaw) {
$subConfigFiles = $subConfigFilesRaw | ConvertFrom-Json -AsHashtable
# Handle cases where $subConfigFilesRaw converts to an empty string
# instead of an array of strings
if ($subConfigFiles) {
foreach ($file in $subConfigFiles) {
Write-Host "Merging sub config from file: $file"
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
foreach ($file in $subConfigFiles) {
# In some cases, $file could be an empty string. Get-Content will fail
# if $file is an empty string, so skip those cases.
if (!$file) {
continue
}
Write-Host "Merging sub config from file: $file"
$subConfig = Get-Content $file | ConvertFrom-Json -AsHashtable
$finalConfig = UpdateSubscriptionConfiguration $finalConfig $subConfig
}
}
Expand Down

0 comments on commit e98c997

Please sign in to comment.