fix: use new URL() for cwd path in build.ts review generation step

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
kingboung 2026-05-07 18:41:41 +08:00
parent 083e2a7cfc
commit 00e37eeccd

View File

@ -13,7 +13,7 @@ console.log('Generating review builtin files...')
const { spawnSync: genSpawnSync } = await import('child_process')
const genResult = genSpawnSync('bun', ['run', 'scripts/generate-review-builtin.ts'], {
stdio: 'inherit',
cwd: import.meta.dir?.replace(/[^/\\]*$/, '') || '.',
cwd: new URL('.', import.meta.url).pathname,
})
if (genResult.status !== 0) {
console.warn('Warning: generate-review-builtin.ts failed, using existing files')