mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-27 13:37:09 +00:00
move to common/platform/filesystem
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
xlua "github.com/xtls/xray-core/common/lua"
|
||||
"github.com/xtls/xray-core/common/platform"
|
||||
"github.com/xtls/xray-core/common/platform/filesystem"
|
||||
"github.com/xtls/xray-core/main/commands/base"
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ func executeSign(cmd *base.Command, args []string) {
|
||||
cmd.Usage()
|
||||
}
|
||||
|
||||
input, info, err := platform.ResolveRegularFile(args[0])
|
||||
input, info, err := filesystem.ResolveRegularFile(args[0])
|
||||
if err != nil {
|
||||
base.Fatalf("failed to inspect Lua file: %s", err)
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func executeSign(cmd *base.Command, args []string) {
|
||||
}
|
||||
|
||||
func writeSignedFile(path string, code []byte, mode os.FileMode) error {
|
||||
if resolved, info, err := platform.ResolveRegularFile(path); err == nil {
|
||||
if resolved, info, err := filesystem.ResolveRegularFile(path); err == nil {
|
||||
path = resolved
|
||||
mode = info.Mode().Perm()
|
||||
} else if !os.IsNotExist(err) {
|
||||
|
||||
Vendored
+2
-2
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"github.com/xtls/xray-core/common/buf"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
"github.com/xtls/xray-core/common/platform"
|
||||
"github.com/xtls/xray-core/common/platform/filesystem"
|
||||
"github.com/xtls/xray-core/common/utils"
|
||||
"github.com/xtls/xray-core/main/commands/base"
|
||||
"github.com/xtls/xray-core/main/confloader"
|
||||
@@ -59,7 +59,7 @@ func readConfigFile(file *os.File) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
if info.Mode().IsRegular() {
|
||||
path, _, err := platform.ResolveRegularFile(file.Name())
|
||||
path, _, err := filesystem.ResolveRegularFile(file.Name())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user