1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00

filter .json in confDir

This commit is contained in:
vcptr 2019-12-31 13:11:34 +08:00
parent 5ae47d45c2
commit c3f55dcd67
2 changed files with 6 additions and 2 deletions

View File

@ -41,7 +41,9 @@ func (c *ConfigCommand) Execute(args []string) error {
r, err := c.LoadArg(arg) r, err := c.LoadArg(arg)
common.Must(err) common.Must(err)
c, err := serial.DecodeJSONConfig(r) c, err := serial.DecodeJSONConfig(r)
common.Must(err) if err != nil {
ctllog.Fatalln(err)
}
conf.Override(c, arg) conf.Override(c, arg)
} }

View File

@ -46,7 +46,9 @@ func readConfDir(dirPath string) {
log.Fatalln(err) log.Fatalln(err)
} }
for _, f := range confs { for _, f := range confs {
configFiles.Set(path.Join(dirPath, f.Name())) if strings.HasSuffix(f.Name(), ".json") {
configFiles.Set(path.Join(dirPath, f.Name()))
}
} }
} }