喵喵更新自动重启适配node app的启动方式

This commit is contained in:
Sirly 2022-06-16 00:59:43 +00:00 committed by GitHub
parent b393fbcba9
commit 7a86df5094

View File

@ -180,7 +180,10 @@ export async function updateMiaoPlugin(e) {
qq: e.user_id
}), { EX: 30 });
timer = setTimeout(function () {
let command = "npm run restart";
let command = `npm run start`;
if(process.argv[1].includes("pm2")){
command = `npm run restart`;
}
exec(command, function (error, stdout, stderr) {
if (error) {
if (/Yunzai not found/.test(error)) {