Update publish.cjs

This commit is contained in:
全栈小学生 2025-04-19 10:41:06 +08:00
parent 6f941fab4d
commit a602c4645b

View File

@ -115,6 +115,20 @@ const listenWeappRunDev = () => {
handleWeappLanguage('dev')
}
});
// 监听 stderr 输出,用于捕获错误信息
devProcess.stderr.on('data', (data) => {
console.error(data.toString());
});
// 监听子进程退出事件
devProcess.on('close', (code) => {
if (code !== 0) { // 如果退出码不是0则认为发生了错误
console.error(`Child process exited with code ${code}`);
} else {
console.log('Child process exited successfully.');
}
});
}
main()