From 3cd145a6f041f4c1bc4cae181e7254b0968a07c8 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Tue, 13 Apr 2021 18:15:06 +0100 Subject: [PATCH] fix not creating test dir in some environment --- infra/conf/router_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infra/conf/router_test.go b/infra/conf/router_test.go index 932d8e8a1..2bc55472c 100644 --- a/infra/conf/router_test.go +++ b/infra/conf/router_test.go @@ -28,9 +28,10 @@ func init() { os.Setenv("v2ray.location.asset", tempPath) + common.Must(os.MkdirAll(tempPath, 0755)) + 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) common.Must(filesystem.WriteFile(geoipPath, geoipBytes))