mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-05-18 13:09:04 -04:00
Fix test
command does not load default config.json
(#1368)
This commit is contained in:
parent
ed9641dad1
commit
c25e33c423
@ -2,9 +2,7 @@ package commands
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
|
|
||||||
core "github.com/v2fly/v2ray-core/v4"
|
|
||||||
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
"github.com/v2fly/v2ray-core/v4/main/commands/base"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -51,24 +49,9 @@ Use "{{.Exec}} help format-loader" for more information about format.
|
|||||||
func executeTest(cmd *base.Command, args []string) {
|
func executeTest(cmd *base.Command, args []string) {
|
||||||
setConfigFlags(cmd)
|
setConfigFlags(cmd)
|
||||||
cmd.Flag.Parse(args)
|
cmd.Flag.Parse(args)
|
||||||
|
|
||||||
extension, err := core.GetLoaderExtensions(*configFormat)
|
|
||||||
if err != nil {
|
|
||||||
base.Fatalf(err.Error())
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(configDirs) > 0 {
|
|
||||||
dirReader := readConfDir
|
|
||||||
if *configDirRecursively {
|
|
||||||
dirReader = readConfDirRecursively
|
|
||||||
}
|
|
||||||
for _, d := range configDirs {
|
|
||||||
log.Println("Using confdir from arg:", d)
|
|
||||||
configFiles = append(configFiles, dirReader(d, extension)...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printVersion()
|
printVersion()
|
||||||
_, err = startV2Ray()
|
configFiles = getConfigFilePath()
|
||||||
|
_, err := startV2Ray()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
base.Fatalf("Test failed: %s", err)
|
base.Fatalf("Test failed: %s", err)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user