修复运行批处理的 bug

This commit is contained in:
fofolee 2019-06-12 19:06:11 +08:00
parent cce2bb6d1f
commit bb54805b7e
2 changed files with 5 additions and 2 deletions

View File

@ -16,8 +16,8 @@ utools.onPluginEnter(({ code, type, payload }) => {
option = programs[db.program];
// 通过主输入框直接进入
if (type == 'over') cmd = cmd.replace(/\{\{input\}\}/mg, payload);
// 忽略输出直接退出插件
if (db.output == "ignore") utools.outPlugin();
// 无输出的批处理
if (db.output == 'ignore' && option.ext == 'bat') option.bin = 'explorer';
// 运行脚本
window.run(cmd, option, db.codec, (stdout, stderr) => {
// 报错
@ -29,6 +29,9 @@ utools.onPluginEnter(({ code, type, payload }) => {
// 有输出
if (stdout) {
switch (db.output) {
case "ignore":
utools.outPlugin();
break;
case "text":
utools.showMainWindow();
utools.setExpendHeight(600);

Binary file not shown.