mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-17 03:37:29 +08:00
提前退出时如果运行报错了通过 alert 强制弹窗
This commit is contained in:
parent
f3d6b72273
commit
62a4ba19c0
@ -91,14 +91,18 @@ export default {
|
|||||||
hideWindow && utools.hideMainWindow();
|
hideWindow && utools.hideMainWindow();
|
||||||
// 对于本身就没有输出的命令,无法确认命令是否执行完成,所以干脆提前退出插件
|
// 对于本身就没有输出的命令,无法确认命令是否执行完成,所以干脆提前退出插件
|
||||||
// 弊端就是如果勾选了隐藏后台就完全退出的话,会造成命令直接中断
|
// 弊端就是如果勾选了隐藏后台就完全退出的话,会造成命令直接中断
|
||||||
this.fromUtools &&
|
let quitBeforeShowResult = this.fromUtools && outPlugin;
|
||||||
outPlugin &&
|
quitBeforeShowResult &&
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
utools.outPlugin();
|
utools.outPlugin();
|
||||||
}, 500);
|
}, 500);
|
||||||
if (currentCommand.program === "quickcommand") {
|
if (currentCommand.program === "quickcommand") {
|
||||||
window.runCodeInVm(currentCommand.cmd, (stdout, stderr) => {
|
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);
|
!outPlugin && this.showRunResult(stdout, true, action);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -112,7 +116,11 @@ export default {
|
|||||||
option,
|
option,
|
||||||
currentCommand.output === "terminal",
|
currentCommand.output === "terminal",
|
||||||
(stdout, stderr) => {
|
(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);
|
!outPlugin && this.showRunResult(stdout, true, action);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user