Skip to content

Commit 41220cf

Browse files
committed
fix: avoid PowerShell automatic variable collision
1 parent 65e6179 commit 41220cf

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/render-script-reference.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,21 @@ try {
243243
$errors = [Collections.Generic.List[string]]::new()
244244
foreach ($path in $canonical) {
245245
$relative = $path.Substring('scripts/'.Length)
246-
$matches = @($catalog.categories | Where-Object {
246+
$categoryMatches = @($catalog.categories | Where-Object {
247247
$category = $_
248248
@($category.patterns | Where-Object {
249249
$relative -match (ConvertTo-HBRegex -Pattern $_)
250250
}).Count -gt 0
251251
})
252252
if ($path -in @($catalog.excluded)) { continue }
253-
if ($matches.Count -ne 1) {
254-
$errors.Add("$path must match exactly one category; matched $($matches.Count).")
253+
if ($categoryMatches.Count -ne 1) {
254+
$errors.Add("$path must match exactly one category; matched $($categoryMatches.Count).")
255255
continue
256256
}
257-
$assignments.Add([pscustomobject]@{ Path = $path; CategoryId = $matches[0].id })
257+
$assignments.Add([pscustomobject]@{
258+
Path = $path
259+
CategoryId = $categoryMatches[0].id
260+
})
258261
}
259262
foreach ($excluded in @($catalog.excluded)) {
260263
if ($excluded -notin $canonical) {

0 commit comments

Comments
 (0)