mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-19 02:46:33 -05: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) {
|
||||
case cmdarg.Arg:
|
||||
cf := &conf.Config{}
|
||||
for _, arg := range v {
|
||||
for i, arg := range v {
|
||||
newError("Reading config: ", arg).AtInfo().WriteToLog()
|
||||
r, err := confloader.LoadConfig(arg)
|
||||
common.Must(err)
|
||||
c, err := serial.DecodeJSONConfig(r)
|
||||
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)
|
||||
}
|
||||
return cf.Build()
|
||||
|
Loading…
Reference in New Issue
Block a user