validate-article.ts findBriefPath() returns on first iteration #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Location
scripts/validate-article.ts, functionfindBriefPath()(lines 96-108)Problem
The
return p;is inside the for loop, so the function always returns the first candidate without trying alternatives. The remaining code is dead.Impact
Brief lookup is broken for articles whose slug doesn't match the first candidate filename pattern.
Suggested fix
Move
return p;outside the for loop so it only returns after all candidates are tried.Fixed in commit
b5d81be.Changes:
existsSyncimport fromnode:fsfindBriefPath()now iterates all candidates, returning the first that exists on diskCloses #31