Feat: cross compile script

This commit is contained in:
HFO4
2020-03-09 16:53:01 +08:00
parent 30311d181d
commit 68d3131521
16 changed files with 215 additions and 75 deletions

View File

@@ -89,7 +89,7 @@ func Init(path string) {
"{SessionSecret}": util.RandStringRunes(64),
"{HashIDSalt}": util.RandStringRunes(64),
}, defaultConf)
f, err := util.CreatNestedFile("conf.ini")
f, err := util.CreatNestedFile(path)
if err != nil {
util.Log().Panic("无法创建配置文件, %s", err)
}
@@ -101,7 +101,6 @@ func Init(path string) {
}
f.Close()
path = "conf.ini"
}
cfg, err = ini.Load(path)
@@ -125,6 +124,13 @@ func Init(path string) {
}
}
// 重设log等级
if !SystemConfig.Debug {
util.Level = util.LevelInformational
util.GloablLogger = nil
util.Log()
}
}
// mapSection 将配置文件的 Section 映射到结构体上