mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 17:38:41 +00:00
Unify environment var readers
This commit is contained in:
parent
e241e5bda6
commit
4f05e0ac2b
9 changed files with 32 additions and 23 deletions
|
@ -17,15 +17,13 @@ func LineSeparator() string {
|
|||
}
|
||||
|
||||
func GetToolLocation(file string) string {
|
||||
const name = "xray.location.tool"
|
||||
toolPath := EnvFlag{Name: name, AltName: NormalizeEnvName(name)}.GetValue(getExecutableDir)
|
||||
toolPath := NewEnvFlag(UnixToolLocation).GetValue(getExecutableDir)
|
||||
return filepath.Join(toolPath, file)
|
||||
}
|
||||
|
||||
// GetAssetLocation searches for `file` in certain locations
|
||||
func GetAssetLocation(file string) string {
|
||||
const name = "xray.location.asset"
|
||||
assetPath := NewEnvFlag(name).GetValue(getExecutableDir)
|
||||
assetPath := NewEnvFlag(UnixAssetLocation).GetValue(getExecutableDir)
|
||||
defPath := filepath.Join(assetPath, file)
|
||||
for _, p := range []string{
|
||||
defPath,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue