mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-14 10:00:34 +00:00
Commands: "xray run -dump" supports reading JSON from STDIN (#5550)
Fixes https://github.com/XTLS/Xray-core/issues/5534
This commit is contained in:
+5
-1
@@ -64,7 +64,11 @@ func GetMergedConfig(args cmdarg.Arg) (string, error) {
|
|||||||
var files []*ConfigSource
|
var files []*ConfigSource
|
||||||
supported := []string{"json", "yaml", "toml"}
|
supported := []string{"json", "yaml", "toml"}
|
||||||
for _, file := range args {
|
for _, file := range args {
|
||||||
format := GetFormat(file)
|
format := "json"
|
||||||
|
if file != "stdin:" {
|
||||||
|
format = GetFormat(file)
|
||||||
|
}
|
||||||
|
|
||||||
if slices.Contains(supported, format) {
|
if slices.Contains(supported, format) {
|
||||||
files = append(files, &ConfigSource{
|
files = append(files, &ConfigSource{
|
||||||
Name: file,
|
Name: file,
|
||||||
|
|||||||
Reference in New Issue
Block a user