mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 10:01:28 +00:00
This reverts commit eaf401eda9
.
This commit is contained in:
parent
8c0d3c0257
commit
ff5ce767df
|
@ -3,7 +3,7 @@ package filesystem
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"github.com/xtls/xray-core/common/buf"
|
"github.com/xtls/xray-core/common/buf"
|
||||||
"github.com/xtls/xray-core/common/platform"
|
"github.com/xtls/xray-core/common/platform"
|
||||||
)
|
)
|
||||||
|
@ -11,11 +11,7 @@ import (
|
||||||
type FileReaderFunc func(path string) (io.ReadCloser, error)
|
type FileReaderFunc func(path string) (io.ReadCloser, error)
|
||||||
|
|
||||||
var NewFileReader FileReaderFunc = func(path string) (io.ReadCloser, error) {
|
var NewFileReader FileReaderFunc = func(path string) (io.ReadCloser, error) {
|
||||||
resolved_path,err:=filepath.EvalSymlinks(path)
|
return os.Open(path)
|
||||||
if err!= nil{
|
|
||||||
return nil,err
|
|
||||||
}
|
|
||||||
return os.Open(resolved_path)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReadFile(path string) ([]byte, error) {
|
func ReadFile(path string) ([]byte, error) {
|
||||||
|
|
|
@ -2,7 +2,6 @@ package serial
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/xtls/xray-core/core"
|
"github.com/xtls/xray-core/core"
|
||||||
"github.com/xtls/xray-core/infra/conf"
|
"github.com/xtls/xray-core/infra/conf"
|
||||||
|
@ -11,11 +10,7 @@ import (
|
||||||
|
|
||||||
func BuildConfig(files []string, formats []string) (*core.Config, error) {
|
func BuildConfig(files []string, formats []string) (*core.Config, error) {
|
||||||
cf := &conf.Config{}
|
cf := &conf.Config{}
|
||||||
for i, file_ := range files {
|
for i, file := range files {
|
||||||
file, err := filepath.EvalSymlinks(file_)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
newError("Reading config: ", file).AtInfo().WriteToLog()
|
newError("Reading config: ", file).AtInfo().WriteToLog()
|
||||||
r, err := confloader.LoadConfig(file)
|
r, err := confloader.LoadConfig(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue