Skip to content

Commit 3066c59

Browse files
authored
[TypeSpec Validation] Skip deleted folders in Get-TypeSpec-Folders.ps1 (#25841)
- Fixes #25839
1 parent 1fc7fb0 commit 3066c59

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

eng/scripts/Get-TypeSpec-Folders.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ else {
5151
$typespecFolders = @()
5252
foreach ($file in $changedFiles) {
5353
if ($file -match 'specification\/[^\/]*\/') {
54-
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.* -Recurse).Directory.FullName | ForEach-Object {if ($_) { [IO.Path]::GetRelativePath($($pwd.path), $_) }}
55-
$typespecFolders += $typespecFolder -replace '\\', '/'
54+
if (Test-Path $matches[0]) {
55+
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.* -Recurse).Directory.FullName | ForEach-Object {if ($_) { [IO.Path]::GetRelativePath($($pwd.path), $_) }}
56+
$typespecFolders += $typespecFolder -replace '\\', '/'
57+
} else {
58+
Write-Host "Cannot find directory $($matches[0])"
59+
}
5660
}
5761
}
5862

0 commit comments

Comments
 (0)