1
0
镜像自地址 https://github.com/beego/bee.git 已同步 2026-03-15 21:30:49 +00:00

add InitToml and fmt code

这个提交包含在:
王厚伟
2020-11-26 14:15:00 +08:00
父节点 62abed87e9
当前提交 b8213eba24
修改 4 个文件,包含 22 行新增5 行删除

查看文件

@@ -208,3 +208,21 @@ func (c *Container) flushTimestamp() {
beeLogger.Log.Fatalf("flush timestamp tmpl parse error, err: %s", err)
}
}
func (c *Container) InitToml() {
if exist := utils.IsExist(c.BeegoProFile); exist {
beeLogger.Log.Fatalf("file beegopro.toml already exists")
}
sourceFile := c.UserOption.GitLocalPath + "/beegopro.toml"
input, err := ioutil.ReadFile(sourceFile)
if err != nil {
beeLogger.Log.Fatalf("read beegopro.toml file err, %s", err.Error())
return
}
err = ioutil.WriteFile(c.BeegoProFile, input, 0644)
if err != nil {
beeLogger.Log.Fatalf("create beegopro.toml file err, %s", err.Error())
return
}
beeLogger.Log.Success("Successfully created file beegopro.toml")
}