mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-12-15 09:34:00 +08:00
Chore: Remove ctlcmd and leftover envvar (#5392)
https://github.com/v2fly/v2ray-core/issues/360
This commit is contained in:
committed by
GitHub
parent
bd7503d506
commit
aea123842b
@@ -64,7 +64,7 @@ func GetMergedConfig(args cmdarg.Arg) (string, error) {
|
||||
var files []*ConfigSource
|
||||
supported := []string{"json", "yaml", "toml"}
|
||||
for _, file := range args {
|
||||
format := getFormat(file)
|
||||
format := GetFormat(file)
|
||||
if slices.Contains(supported, format) {
|
||||
files = append(files, &ConfigSource{
|
||||
Name: file,
|
||||
@@ -98,7 +98,7 @@ func getExtension(filename string) string {
|
||||
return filename[idx+1:]
|
||||
}
|
||||
|
||||
func getFormat(filename string) string {
|
||||
func GetFormat(filename string) string {
|
||||
return GetFormatByExtension(getExtension(filename))
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func LoadConfig(formatName string, input interface{}) (*Config, error) {
|
||||
|
||||
if formatName == "auto" {
|
||||
if file != "stdin:" {
|
||||
f = getFormat(file)
|
||||
f = GetFormat(file)
|
||||
} else {
|
||||
f = "json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user