Files
analysis_claude_code/web/scripts
chx7776-afk e1a35baa8b fix(web): replace fs.cpSync to avoid Windows crash in extract step (#574)
`fs.cpSync` in `copyChapterAssets` terminates the Node process on Windows
with Node 22. Running `npm run extract` (the `predev` hook of `npm run dev`)
prints "Source: root chapter folders (17)" and then exits with
STATUS_STACK_BUFFER_OVERRUN (exit code 0xC0000409) without any JS-level
error, so the course data is never written and the dev server never starts.

Replace it with a small recursive copy helper built on `fs.readdirSync` +
`fs.copyFileSync`, which is what `fs.cpSync` does internally minus the
native path that crashes here.

Verified on Windows 11 / Node v22.20.0:
- before: exit 0xC0000409, extraction aborted, no course-assets output
- after:  exit 0, "17 versions / 16 diffs / 51 docs", 74 asset files written
2026-10-27 12:40:19 +08:00
..