Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle empty files in Test-SampleMetadata
Browse files Browse the repository at this point in the history
heaths authored and azure-sdk committed Apr 15, 2021
1 parent 179d409 commit 138a930
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
@@ -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()

0 comments on commit 138a930

Please sign in to comment.