豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit d75b33a

Browse files
authored
Commands: "xray run -dump" supports reading JSON from STDIN (#5550)
Fixes #5534
1 parent 7c41848 commit d75b33a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/config.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ func GetMergedConfig(args cmdarg.Arg) (string, error) {
6464
var files []*ConfigSource
6565
supported := []string{"json", "yaml", "toml"}
6666
for _, file := range args {
67-
format := GetFormat(file)
67+
format := "json"
68+
if file != "stdin:" {
69+
format = GetFormat(file)
70+
}
71+
6872
if slices.Contains(supported, format) {
6973
files = append(files, &ConfigSource{
7074
Name: file,

0 commit comments

Comments
 (0)