@ryantest/openclaw-qqbot 1.6.7-beta.12 → 1.6.7-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -826,8 +826,12 @@ function fireHotUpgrade(targetVersion, pkg, useLocal) {
826
826
  catch { /* ignore */ }
827
827
  }
828
828
  // 异步执行升级脚本
829
+ // 必须显式设置 cwd 为一个确定存在的目录(如 homeDir),
830
+ // 否则子进程继承 gateway 的 cwd,如果该目录在升级过程中被删除/移动,
831
+ // openclaw CLI 启动时 process.cwd() 会报 ENOENT: uv_cwd 错误。
829
832
  execFile(shell, shellArgs, {
830
833
  timeout: 120_000,
834
+ cwd: homeDir,
831
835
  env: childEnv,
832
836
  ...(isWindows() ? { windowsHide: true } : {}),
833
837
  }, (error, stdout, _stderr) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryantest/openclaw-qqbot",
3
- "version": "1.6.7-beta.12",
3
+ "version": "1.6.7-beta.14",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,6 +18,11 @@
18
18
 
19
19
  set -eo pipefail
20
20
 
21
+ # 确保 cwd 是一个存在的目录。
22
+ # 当从 gateway 进程 fork 时,继承的 cwd 可能已被删除(如旧插件目录被 mv/rm),
23
+ # 导致 openclaw CLI 启动时 process.cwd() 报 ENOENT: uv_cwd 错误。
24
+ cd "$HOME" 2>/dev/null || cd / 2>/dev/null || true
25
+
21
26
  # 异常退出时清理临时文件并回滚(防止泄露或残留)
22
27
  INSTALL_COMPLETED=false # 标记 install 是否已完成(用于区分正常退出和异常退出)
23
28
  cleanup_on_exit() {
@@ -919,8 +919,12 @@ function fireHotUpgrade(targetVersion?: string, pkg?: string, useLocal?: boolean
919
919
  }
920
920
 
921
921
  // 异步执行升级脚本
922
+ // 必须显式设置 cwd 为一个确定存在的目录(如 homeDir),
923
+ // 否则子进程继承 gateway 的 cwd,如果该目录在升级过程中被删除/移动,
924
+ // openclaw CLI 启动时 process.cwd() 会报 ENOENT: uv_cwd 错误。
922
925
  execFile(shell, shellArgs, {
923
926
  timeout: 120_000,
927
+ cwd: homeDir,
924
928
  env: childEnv,
925
929
  ...(isWindows() ? { windowsHide: true } : {}),
926
930
  }, (error, stdout, _stderr) => {