Skip to content

fix(plugin): handle EXDEV cross-filesystem rename during install#488

Merged
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:fix/plugin-exdev-rename
Mar 27, 2026
Merged

fix(plugin): handle EXDEV cross-filesystem rename during install#488
jackwener merged 2 commits intojackwener:mainfrom
ByteYue:fix/plugin-exdev-rename

Conversation

@ByteYue
Copy link
Copy Markdown
Collaborator

@ByteYue ByteYue commented Mar 27, 2026

Problem

fs.renameSync() fails with EXDEV when source and destination are on different filesystem mount points. This commonly happens because plugin clones land in os.tmpdir() (often /tmp on a tmpfs) while plugins are installed to ~/.opencli/plugins/ (on the root filesystem).

Fix

Add a moveDir() helper that catches EXDEV and falls back to fs.cpSync() + fs.rmSync(). Applied to both single-plugin and monorepo install paths.

Testing

All 337 unit tests pass.

fs.renameSync() fails with EXDEV when source and destination are on
different filesystem mount points. This commonly happens because plugin
clones land in os.tmpdir() (often /tmp on a tmpfs) while plugins are
installed to ~/.opencli/plugins/ (on the root filesystem).

Add a moveDir() helper that catches EXDEV and falls back to
fs.cpSync() + fs.rmSync(). Applied to both single-plugin and monorepo
install paths.
@jackwener jackwener force-pushed the fix/plugin-exdev-rename branch from bb287b7 to 717f382 Compare March 27, 2026 06:10
@jackwener jackwener merged commit 55d0473 into jackwener:main Mar 27, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants