提前退出时如果运行报错了通过 alert 强制弹窗

This commit is contained in:
fofolee 2022-04-16 13:12:09 +08:00
parent f3d6b72273
commit 62a4ba19c0

View File

@ -91,14 +91,18 @@ export default {
hideWindow && utools.hideMainWindow();
// 退
// 退
this.fromUtools &&
outPlugin &&
let quitBeforeShowResult = this.fromUtools && outPlugin;
quitBeforeShowResult &&
setTimeout(() => {
utools.outPlugin();
}, 500);
if (currentCommand.program === "quickcommand") {
window.runCodeInVm(currentCommand.cmd, (stdout, stderr) => {
if (stderr) return this.showRunResult(stderr, false, action);
if (stderr) {
return quitBeforeShowResult
? alert(stderr)
: this.showRunResult(stderr, false, action);
}
!outPlugin && this.showRunResult(stdout, true, action);
});
} else {
@ -112,7 +116,11 @@ export default {
option,
currentCommand.output === "terminal",
(stdout, stderr) => {
if (stderr) return this.showRunResult(stderr, false, action);
if (stderr) {
return quitBeforeShowResult
? alert(stderr)
: this.showRunResult(stderr, false, action);
}
!outPlugin && this.showRunResult(stdout, true, action);
}
);