From 37af0bd7a62c71c512ddefabb5ca386fcc78ed2e Mon Sep 17 00:00:00 2001 From: Cheney Date: Thu, 13 Mar 2025 15:16:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kit/src/config/SystemConfig.js | 10 +++++----- kit/src/kitcommand.js | 7 ++++++- kit/src/remote/index.js | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/kit/src/config/SystemConfig.js b/kit/src/config/SystemConfig.js index 068b157..2d47755 100644 --- a/kit/src/config/SystemConfig.js +++ b/kit/src/config/SystemConfig.js @@ -47,11 +47,11 @@ module.exports = class SystemConfig { } static getUserPath() { - let userDirectory = '~'; - if ( this.isWindows() ) { - userDirectory = process.env.USERPROFILE; - } - return userDirectory; + // let userDirectory = '~'; + // if ( this.isWindows() ) { + // userDirectory = process.env.USERPROFILE; + // } + return os.homedir(); } static getUserConfigPath() { diff --git a/kit/src/kitcommand.js b/kit/src/kitcommand.js index f258938..6de93b5 100644 --- a/kit/src/kitcommand.js +++ b/kit/src/kitcommand.js @@ -1,4 +1,5 @@ const shell = require("./shell"); +const os = require("os"); module.exports = { @@ -12,7 +13,11 @@ module.exports = { shell.execSync("start " + uConfig.get("man")) }); parser.addCmdLine("manu", "人工维护配置;", function () { - shell.execSync("start " + $sConfig.getUserConfigPath()) + if (os.type() === 'Windows_NT') { + shell.execSync("start " + $sConfig.getUserConfigPath()) + } else { + console.log("请用浏览器访问:" + $sConfig.getUserConfigPath()) + } }); parser.addCmdLine("run [--file] [func]", "运行项目脚本;", function (cli) { diff --git a/kit/src/remote/index.js b/kit/src/remote/index.js index b009b02..9d6f4e4 100644 --- a/kit/src/remote/index.js +++ b/kit/src/remote/index.js @@ -48,10 +48,12 @@ module.exports = class Remote { async check() { if ( ! this.webdav ) { + $logger.info("webdav unable") return false } if ( ! this.client ) { + $logger.info("client unable") return false }