diff --git a/kit/src/init.js b/kit/src/init.js index f56b8d8..78e2926 100644 --- a/kit/src/init.js +++ b/kit/src/init.js @@ -1,6 +1,5 @@ const config = require('./config') const Context = require("./context") -const log4js = require("log4js"); // const layout = log4js.layouts.patternLayout('%m') if ( ! global.$inited ) { init() diff --git a/kit/src/kitcommand.js b/kit/src/kitcommand.js index 6de93b5..4adc431 100644 --- a/kit/src/kitcommand.js +++ b/kit/src/kitcommand.js @@ -10,16 +10,19 @@ module.exports = { parser.addCmdLine("help", "打开在线帮助;", async function () { const uConfig = await $context.get("uConfig") - shell.execSync("start " + uConfig.get("man")) + if (os.type() === 'Windows_NT') { + shell.execSync("start " + uConfig.get("man")) + } else { + console.log("请用浏览器访问 " + uConfig.get("man")) + } }); parser.addCmdLine("manu", "人工维护配置;", function () { if (os.type() === 'Windows_NT') { shell.execSync("start " + $sConfig.getUserConfigPath()) } else { - console.log("请用浏览器访问:" + $sConfig.getUserConfigPath()) + console.log("cd " + $sConfig.getUserConfigPath()) } }); - parser.addCmdLine("run [--file] [func]", "运行项目脚本;", function (cli) { $logger.info("kit 当前执行目录 " + process.cwd()); const fs = require("fs"); @@ -77,7 +80,7 @@ async function main(){ } }); - parser.addCmdLine("remote-check", "验证远程仓库;", async function () { + parser.addCmdLine("remote", "验证远程仓库;", async function () { let remote = await $context.get("remote") if (!(await remote.check())) { $logger.error("远程仓库不可用") diff --git a/kit/src/remote/index.js b/kit/src/remote/index.js index 9d6f4e4..283fd7f 100644 --- a/kit/src/remote/index.js +++ b/kit/src/remote/index.js @@ -79,6 +79,7 @@ module.exports = class Remote { return true }catch ( e ) { $logger.error("remote check 过程中出错", e) + console.error(e) return false } }