mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-05-03 19:19:08 -04:00
Fix: v2ray.location.asset env not working (#889)
This commit is contained in:
@@ -2,6 +2,7 @@ package router_test
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
@@ -32,8 +33,8 @@ func init() {
|
||||
|
||||
os.Setenv("v2ray.location.asset", tempPath)
|
||||
|
||||
if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && errors.Is(err, os.ErrNotExist) {
|
||||
if _, err := os.Stat(geoipPath); err != nil && errors.Is(err, os.ErrNotExist) {
|
||||
if _, err := os.Stat(platform.GetAssetLocation("geoip.dat")); err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
if _, err := os.Stat(geoipPath); err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
common.Must(os.MkdirAll(tempPath, 0755))
|
||||
geoipBytes, err := common.FetchHTTPContent(geoipURL)
|
||||
common.Must(err)
|
||||
@@ -41,8 +42,8 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && errors.Is(err, os.ErrNotExist) {
|
||||
if _, err := os.Stat(geositePath); err != nil && errors.Is(err, os.ErrNotExist) {
|
||||
if _, err := os.Stat(platform.GetAssetLocation("geosite.dat")); err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
if _, err := os.Stat(geositePath); err != nil && errors.Is(err, fs.ErrNotExist) {
|
||||
common.Must(os.MkdirAll(tempPath, 0755))
|
||||
geositeBytes, err := common.FetchHTTPContent(geositeURL)
|
||||
common.Must(err)
|
||||
|
||||
Reference in New Issue
Block a user