Skip to content

Commit

Permalink
Handle empty files in Test-SampleMetadata
Browse files Browse the repository at this point in the history
Relates to #20684
  • Loading branch information
heaths authored and azure-sdk committed Apr 15, 2021
1 parent 29c0a06 commit dec7176
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion eng/common/scripts/Test-SampleMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ process {
}

[string[]] $content = $file | Get-Content
if (!$content[0].StartsWith('---')) {
if (!$content -or !$content[0].StartsWith('---')) {
Write-Verbose "Skipping $($file.FullName): does not contain frontmatter"
continue
}

Write-Verbose "Checking $($file.FullName)"

# Reset metadata and create mutable collections.
$products = [System.Collections.Generic.List[string]]::new()

Expand Down

0 comments on commit dec7176

Please sign in to comment.