From d05bb4cfe6dd1f86b5b1390cb3569bb6d9acdf26 Mon Sep 17 00:00:00 2001 From: Cheney Date: Thu, 13 Mar 2025 15:27:23 +0800 Subject: [PATCH] =?UTF-8?q?remote=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kit/src/init.js | 1 - kit/src/kitcommand.js | 11 +++++++---- kit/src/remote/index.js | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) 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 } }