refactor(config): 简化配置文件创建逻辑
- 移除冗余的日志记录和文件创建操作 - 直接将YAML内容写入配置文件 - 保持配置文件创建成功的日志提示main v1.0.1001
parent
7218ba6508
commit
1eda606705
|
|
@ -140,8 +140,6 @@ func DefaultConfigInit() {
|
||||||
}
|
}
|
||||||
g.Log().Info(gctx.New(), "正在检查配置文件", gfile.IsFile(ConfigPath))
|
g.Log().Info(gctx.New(), "正在检查配置文件", gfile.IsFile(ConfigPath))
|
||||||
if !gfile.IsFile(ConfigPath) {
|
if !gfile.IsFile(ConfigPath) {
|
||||||
g.Log().Info(gctx.New(), "正在创建配置文件", ConfigPath)
|
|
||||||
_, _ = gfile.Create(ConfigPath)
|
|
||||||
g.Log().Info(gctx.New(), "正在写入配置文件", ConfigPath)
|
g.Log().Info(gctx.New(), "正在写入配置文件", ConfigPath)
|
||||||
_ = gfile.PutContents(ConfigPath, gconv.String(yaml))
|
_ = gfile.PutContents(ConfigPath, gconv.String(yaml))
|
||||||
g.Log().Info(gctx.New(), "配置文件创建成功!")
|
g.Log().Info(gctx.New(), "配置文件创建成功!")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue