Adjust JSON & TOML & YAML

This commit is contained in:
RPRX 2020-12-25 18:53:17 +08:00
parent 3d7e86efba
commit ffd8fd1d8a
9 changed files with 32 additions and 75 deletions

View file

@ -22,9 +22,13 @@ func init() {
for i, arg := range v {
newError("Reading config: ", arg).AtInfo().WriteToLog()
r, err := confloader.LoadConfig(arg)
common.Must(err)
if err != nil {
return nil, newError("failed to read config: ", arg).Base(err)
}
c, err := serial.DecodeYAMLConfig(r)
common.Must(err)
if err != nil {
return nil, newError("failed to decode config: ", arg).Base(err)
}
if i == 0 {
// This ensure even if the muti-json parser do not support a setting,
// It is still respected automatically for the first configure file