Skip to content

Commit

Permalink
Fix test command does not load default config.json (v2fly#1368)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyhkwong authored Nov 6, 2021
1 parent ed9641d commit c25e33c
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions main/commands/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package commands

import (
"fmt"
"log"

core "github.com/v2fly/v2ray-core/v4"
"github.com/v2fly/v2ray-core/v4/main/commands/base"
)

Expand Down Expand Up @@ -51,24 +49,9 @@ Use "{{.Exec}} help format-loader" for more information about format.
func executeTest(cmd *base.Command, args []string) {
setConfigFlags(cmd)
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()
_, err = startV2Ray()
configFiles = getConfigFilePath()
_, err := startV2Ray()
if err != nil {
base.Fatalf("Test failed: %s", err)
}
Expand Down

0 comments on commit c25e33c

Please sign in to comment.