panrouter 6.3.10 → 6.3.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/pool-worker.mjs +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "panrouter",
3
- "version": "6.3.10",
3
+ "version": "6.3.11",
4
4
  "description": "让 Claude Code 免费使用 DeepSeek 等模型,无需 API Key",
5
5
  "type": "module",
6
6
  "bin": {
package/pool-worker.mjs CHANGED
@@ -238,10 +238,10 @@ function handleUpgrade() {
238
238
  // Windows:无论如何走 start /b 脚本(当前进程锁着 npm 目录无法内联升级)
239
239
  if (process.platform === 'win32') {
240
240
  const tmpDir = process.env.TEMP || process.env.TMP || "C:\\Windows\\Temp";
241
- // 如果已经是最新版也跳过 install
242
- const noInstall = hasNewer ? "" : "& npm cache clean --force 2>nul & npm install -g panrouter@latest";
243
- // 先 ping 等当前进程退出锁释放 → 杀残留 node → 切 tmp 目录避免被删 → install → 启动
244
- const upgradeCmd = `start /b cmd /c "@ping 127.0.0.1 -n 3 >nul && taskkill /f /im node.exe 2>nul & ping 127.0.0.1 -n 3 >nul & cd /d \"${tmpDir}\"${noInstall} && panrouter --pool"`;
241
+ // 只有新版本才需要 install
242
+ const doInstall = hasNewer ? "& npm cache clean --force 2>nul & npm install -g panrouter@latest" : "";
243
+ // 先 ping 等当前进程退出锁释放 → 杀残留 node → install → 启动
244
+ const upgradeCmd = `start /b cmd /c "@ping 127.0.0.1 -n 3 >nul && taskkill /f /im node.exe 2>nul & ping 127.0.0.1 -n 3 >nul & cd /d \"${tmpDir}\"${doInstall} & panrouter --pool"`;
245
245
  try { execSync(upgradeCmd, { stdio: 'pipe', timeout: 5000, shell: true }); } catch {}
246
246
  log("升级脚本已提交 (当前进程退出后自动执行),旧进程退出", "OFF");
247
247
  process.exit(0);