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

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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)