Skip to content

Commit

Permalink
[TypeSpec Validation] Skip deleted folders in Get-TypeSpec-Folders.ps1 (
Browse files Browse the repository at this point in the history
#25841)

- Fixes #25839
  • Loading branch information
ckairen authored and jnlycklama committed Nov 8, 2023
1 parent 09896c7 commit 2c53d5e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions eng/scripts/Get-TypeSpec-Folders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ else {
$typespecFolders = @()
foreach ($file in $changedFiles) {
if ($file -match 'specification\/[^\/]*\/') {
$typespecFolder = (Get-ChildItem -path $matches[0] tspconfig.* -Recurse).Directory.FullName | ForEach-Object {if ($_) { [IO.Path]::GetRelativePath($($pwd.path), $_) }}
$typespecFolders += $typespecFolder -replace '\\', '/'
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])"
}
}
}

Expand Down

0 comments on commit 2c53d5e

Please sign in to comment.