Skip to content

fix: 修复构建脚本中 rmSync 无法删除目录符号链接的问题#2

Closed
arthurlee116 wants to merge 1 commit intoop7418:mainfrom
arthurlee116:fix/build-rmsync-recursive
Closed

fix: 修复构建脚本中 rmSync 无法删除目录符号链接的问题#2
arthurlee116 wants to merge 1 commit intoop7418:mainfrom
arthurlee116:fix/build-rmsync-recursive

Conversation

@arthurlee116
Copy link

问题

执行 npm run electron:build 时,scripts/build-electron.mjs 在解析 .next/standalone/.next/node_modules/ 中的符号链接时报错:

Error: Path is a directory: .next/standalone/.next/node_modules/better-sqlite3-90e2652d1716b047
    at Object.rmSync (node:fs:1236:18)
    at resolveStandaloneSymlinks (file:///...CodePilot/scripts/build-electron.mjs:18:12)

部分条目(如 better-sqlite3-90e2652d1716b047)是指向目录的符号链接,fs.rmSync() 在未传入 { recursive: true } 时会抛出 ERR_FS_EISDIR 错误。

修复

fs.rmSync() 添加 { recursive: true, force: true } 参数。

Copilot AI review requested due to automatic review settings February 7, 2026 07:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复 Electron 构建脚本在处理 Next.js standalone 输出中的“指向目录的符号链接”时,因 fs.rmSync() 未开启递归删除而报错的问题,保证 npm run electron:build 可正常执行并为后续 electron-builder 打包准备好可复制的目录结构。

Changes:

  • 为删除 standalone 目录下的符号链接时的 fs.rmSync() 增加 { recursive: true, force: true } 参数,避免遇到目录型符号链接时报 ERR_FS_EISDIR

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@op7418
Copy link
Owner

op7418 commented Feb 7, 2026

Thanks for the fix! This change was already included in PR #7 which has been merged. Closing as duplicate.

@op7418 op7418 closed this Feb 7, 2026
op7418 pushed a commit that referenced this pull request Mar 2, 2026
- 目录结构增加 telegram-media.ts
- 数据流图补充图片/相册处理路径
- 设计决策 #2 补充连续水位推进机制
- 新增决策 #9(图片接收)和 #10(DB 格式统一)
- 设置项表增加 image_enabled 和 max_image_size

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants