Skip to content

Commit 5ac0623

Browse files
ckairendargilco
authored andcommitted
[TypeSpec Validation] Remove duplicate error messages in Get-TypeSpec-Folders.ps1 (#25846)
- Continuation of #25841
1 parent 03b8ccd commit 5ac0623

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

eng/scripts/Get-TypeSpec-Folders.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,22 @@ else {
4949
}
5050

5151
$typespecFolders = @()
52+
$skippedTypespecFolders = @()
5253
foreach ($file in $changedFiles) {
5354
if ($file -match 'specification\/[^\/]*\/') {
5455
if (Test-Path $matches[0]) {
5556
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.* -Recurse).Directory.FullName | ForEach-Object {if ($_) { [IO.Path]::GetRelativePath($($pwd.path), $_) }}
5657
$typespecFolders += $typespecFolder -replace '\\', '/'
5758
} else {
58-
Write-Host "Cannot find directory $($matches[0])"
59+
$skippedTypespecFolders += $matches[0]
5960
}
6061
}
6162
}
6263

64+
foreach ($skippedTypespecFolder in $skippedTypespecFolders | Select-Object -Unique) {
65+
Write-Host "Cannot find directory $skippedTypespecFolder"
66+
}
67+
6368
$typespecFolders = $typespecFolders | Select-Object -Unique | Sort-Object
6469

6570
return $typespecFolders

0 commit comments

Comments
 (0)