Skip to content

Commit bcbb0ea

Browse files
committed
fix(check): resolve check-paths.mts via absolute path
The path-hygiene check invoked the gate via a relative `scripts/check-paths.mts` path. When `pnpm run check` runs from a workspace package's cwd (e.g. packages/cli), Node fails to resolve the gate file. All other spawn calls in check.mts already used `path.join(scriptsDir, ...)`; this one was inconsistent. Now passes an absolute gate path AND sets `cwd: repoRoot` so the gate's allowlist YAML and segment imports resolve correctly.
1 parent bc64815 commit bcbb0ea

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

scripts/check.mts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -387,15 +387,16 @@ async function main(): Promise<void> {
387387
logger.log('')
388388
logger.progress('Running path-hygiene check (1 path, 1 reference)')
389389
}
390-
const pathHygieneResult = await spawn(
391-
'node',
392-
['scripts/check-paths.mts', '--quiet'],
393-
{
394-
shell: WIN32,
395-
stdio: 'pipe',
396-
stdioString: true,
397-
},
398-
)
390+
// Resolve the gate path against scripts/ so this runner works
391+
// when invoked from any cwd (root or a workspace package dir).
392+
const gatePath = path.join(scriptsDir, 'check-paths.mts')
393+
const repoRoot = path.dirname(scriptsDir)
394+
const pathHygieneResult = await spawn('node', [gatePath, '--quiet'], {
395+
cwd: repoRoot,
396+
shell: WIN32,
397+
stdio: 'pipe',
398+
stdioString: true,
399+
})
399400
if (pathHygieneResult.code !== 0) {
400401
if (!quiet) {
401402
logger.clearLine()

0 commit comments

Comments
 (0)