From dde9a48645adf424657cd4213e54da3c187a44e2 Mon Sep 17 00:00:00 2001 From: skyle1995 Date: Sat, 6 Dec 2025 19:22:25 +0800 Subject: [PATCH] Fix a configuration error --- cmd/root.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index f9c182b..48bcca7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -78,19 +78,9 @@ func setupLogrusForNonHTTP() { // 设置输出目标(稍后会根据配置文件调整) logrus.SetOutput(os.Stdout) if cfgFile != "" { - // 使用命令行指定的配置文件 config.Init(cfgFile) } else { - // 使用默认配置文件路径,基于可执行文件所在目录 - execPath, err := os.Executable() - if err != nil { - // 如果获取可执行文件路径失败,使用当前工作目录 - config.Init("./config.json") - } else { - execDir := filepath.Dir(execPath) - configPath := filepath.Join(execDir, "config.json") - config.Init(configPath) - } + config.Init("./config.json") } // 根据配置文件进一步配置logrus