Skip to content

Commit

Permalink
[TypeSpec Validation] Remove duplicate error messages in Get-TypeSpec…
Browse files Browse the repository at this point in the history
…-Folders.ps1 (#25846)

- Continuation of #25841
  • Loading branch information
ckairen authored and jnlycklama committed Nov 8, 2023
1 parent 297eb0d commit afcd155
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eng/scripts/Get-TypeSpec-Folders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,22 @@ else {
}

$typespecFolders = @()
$skippedTypespecFolders = @()
foreach ($file in $changedFiles) {
if ($file -match 'specification\/[^\/]*\/') {
if (Test-Path $matches[0]) {
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.* -Recurse).Directory.FullName | ForEach-Object {if ($_) { [IO.Path]::GetRelativePath($($pwd.path), $_) }}
$typespecFolders += $typespecFolder -replace '\\', '/'
} else {
Write-Host "Cannot find directory $($matches[0])"
$skippedTypespecFolders += $matches[0]
}
}
}

foreach ($skippedTypespecFolder in $skippedTypespecFolders | Select-Object -Unique) {
Write-Host "Cannot find directory $skippedTypespecFolder"
}

$typespecFolders = $typespecFolders | Select-Object -Unique | Sort-Object

return $typespecFolders

0 comments on commit afcd155

Please sign in to comment.