-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Thanks for your works!
I'm managing my opencode config directory with symlink for more visible location(~/IdeaProjects/opencode-config).
In this case, during install, atomic move fail and error.code is ENOTDIR and not match in the installer code:
if (error.code === 'EXDEV') {
// Cross-device move needed
this.logger.debug('Cross-device move detected, using copy+delete');
await this._crossDeviceMove(tempDir, targetDir);
} else if (error.code === 'ENOTEMPTY' || error.code === 'EEXIST' || error.code === 'EPERM') {
// Target exists with other files - MERGE instead of replace
// This preserves existing opencode configuration
// NOTE: On Windows, fs.rename throws EPERM instead of ENOTEMPTY/EEXIST
// when target directory exists. Fixed: 2026-02-26
this.logger.debug('Target exists with existing files, merging contents');
await this._mergeDirectories(tempDir, targetDir);
// Clean up temp directory after merge
await fs.rm(tempDir, { recursive: true, force: true });
} else {
throw error;
}
I'm not sure this could be handled, not a big problem, just a minor.
Thanks
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels