diff --git a/src/preload.js b/src/preload.js index b3c3151..dea8484 100644 --- a/src/preload.js +++ b/src/preload.js @@ -28,7 +28,7 @@ const shortCodes = [ }, system = cmd => { - return child_process.execSync(cmd); + child_process.exec(cmd); }, message = msg => { @@ -80,8 +80,13 @@ const quickcommand = { }, showInputBox: function (callback, placeHolders) { - if (typeof callback != 'function') return + let helps = `正确用法: + showInputBox(yourinput => { + do something... + }, [placeholder of input1, placeholder of input2...])` + if (!(callback instanceof Function)) throw helps placeHolders || (placeHolders = [""]) + if (!(placeHolders instanceof Array)) throw helps utools.setExpendHeight(600) var html = "" var inputBoxNumbers = placeHolders.length @@ -103,11 +108,15 @@ const quickcommand = { }, showSelectBox: function (callback, selects) { - if (typeof callback != 'function') return - selects || (selects = [""]) + let helps = `正确用法: + showSelectBox(yourchoise => { + do something... + }, [option1, option2...])` + if (!(callback instanceof Function)) throw helps + if (!(selects instanceof Array) || (selects && !selects.length)) throw helps // 调整插件高度 let modWindowHeight = num => { - utools.setExpendHeight(num > 11 ? 600 : 50 * (num + 1)); + if(!$("#customize").is(":parent")) utools.setExpendHeight(num > 11 ? 600 : 50 * (num + 1)); } var html = `