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.
- package/package.json +1 -1
- package/pool-worker.mjs +4 -4
package/package.json
CHANGED
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
|
-
//
|
|
242
|
-
const
|
|
243
|
-
// 先 ping 等当前进程退出锁释放 → 杀残留 node →
|
|
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}\"${
|
|
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);
|