Skip to content

Conversation

@gaojude
Copy link
Owner

@gaojude gaojude commented Jan 29, 2026

For Contributors

Fixing a bug

For Maintainers

What?

Fixes Windows-specific issues in the agents-md codemod that prevented proper generation of the compressed documentation index.

Why?

On Windows, fs.rmSync could fail with EPERM errors due to open file handles (e.g., by git.exe), and path separators (\ vs /) were not consistently handled, leading to incomplete or failed index creation.

How?

  • Implemented a removeDirSync wrapper with retry logic for EPERM, EBUSY, and ENOTEMPTY errors during directory removal.
  • Updated all fs.rmSync calls in pullDocs and cloneDocsFolder to use the new robust removeDirSync.
  • Normalized Windows backslashes to forward slashes in collectDocFiles for consistent path handling.

Fixes vercel#89240


Slack Thread

Open in Cursor Open in Web

- Add removeDirSync wrapper with retry logic for EPERM/EBUSY/ENOTEMPTY errors
- Replace all fs.rmSync calls with the new Windows-safe wrapper
- Normalize Windows backslashes to forward slashes in collectDocFiles
- Fixes vercel#89240
@cursor
Copy link

cursor bot commented Jan 29, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants