Persist PM2 process list after upgrades

This commit is contained in:
FengLee
2026-05-10 00:09:50 +08:00
parent 1a27177f51
commit 70656562b1

View File

@@ -495,7 +495,7 @@ function detectRestartCommand() {
label: '检测 PM2 进程',
});
if (pm2Names.includes('"name":"miaojing-dev"')) return 'pm2 restart miaojing-dev --update-env';
if (fs.existsSync(path.join(projectRoot, 'ecosystem.config.cjs'))) return 'pm2 startOrReload ecosystem.config.cjs --update-env';
if (fs.existsSync(path.join(projectRoot, 'ecosystem.config.cjs'))) return 'pm2 startOrReload ecosystem.config.cjs --update-env && pm2 save';
return 'pm2 restart miaojing-dev --update-env';
}