From 71a231e54356a2beef9023dfda375997bdbb1bf7 Mon Sep 17 00:00:00 2001 From: mzz2017 Date: Sat, 10 Sep 2022 01:04:48 +0800 Subject: [PATCH] fix: invalid --v2ray-assetsdir. #649 --- service/core/v2ray/asset/asset.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/core/v2ray/asset/asset.go b/service/core/v2ray/asset/asset.go index 6d4a9d00..3a3343b1 100644 --- a/service/core/v2ray/asset/asset.go +++ b/service/core/v2ray/asset/asset.go @@ -20,6 +20,15 @@ import ( ) func GetV2rayLocationAssetOverride() string { + if assetDir := conf.GetEnvironmentConfig().V2rayAssetsDirectory; assetDir != "" { + return assetDir + } + if assetDir := os.Getenv("V2RAY_LOCATION_ASSET"); assetDir != "" { + return assetDir + } + if assetDir := os.Getenv("XRAY_LOCATION_ASSET"); assetDir != "" { + return assetDir + } if runtime.GOOS != "windows" { return filepath.Join(xdg.RuntimeDir, "v2raya") } else {