From 62a4ba19c0c9bb8ec540958ad91ca8ecdd7e34ca Mon Sep 17 00:00:00 2001 From: fofolee Date: Sat, 16 Apr 2022 13:12:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=89=8D=E9=80=80=E5=87=BA=E6=97=B6?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E8=BF=90=E8=A1=8C=E6=8A=A5=E9=94=99=E4=BA=86?= =?UTF-8?q?=E9=80=9A=E8=BF=87=20alert=20=E5=BC=BA=E5=88=B6=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CommandRunResult.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 1e41c5e..5924479 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -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); } );