mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-07-26 11:44:22 -04:00
Workaround for muti-json's hard coded override method (#409)
* Simple workaround for muti-json unable to automatically understand new config options. * Update jsonem.go
This commit is contained in:
parent
f96fe0b35d
commit
61112d8af7
@ -19,12 +19,18 @@ func init() {
|
|||||||
switch v := input.(type) {
|
switch v := input.(type) {
|
||||||
case cmdarg.Arg:
|
case cmdarg.Arg:
|
||||||
cf := &conf.Config{}
|
cf := &conf.Config{}
|
||||||
for _, arg := range v {
|
for i, arg := range v {
|
||||||
newError("Reading config: ", arg).AtInfo().WriteToLog()
|
newError("Reading config: ", arg).AtInfo().WriteToLog()
|
||||||
r, err := confloader.LoadConfig(arg)
|
r, err := confloader.LoadConfig(arg)
|
||||||
common.Must(err)
|
common.Must(err)
|
||||||
c, err := serial.DecodeJSONConfig(r)
|
c, err := serial.DecodeJSONConfig(r)
|
||||||
common.Must(err)
|
common.Must(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
|
||||||
|
*cf = *c
|
||||||
|
continue
|
||||||
|
}
|
||||||
cf.Override(c, arg)
|
cf.Override(c, arg)
|
||||||
}
|
}
|
||||||
return cf.Build()
|
return cf.Build()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user