From 9bb2a1d7309deca7c7d275e3fefa5b391a9c5848 Mon Sep 17 00:00:00 2001 From: yanweidong Date: Thu, 3 Oct 2024 20:39:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20env/env.go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- env/env.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/env/env.go b/env/env.go index 1ff1542..88d09bd 100644 --- a/env/env.go +++ b/env/env.go @@ -32,9 +32,14 @@ func NewEnv() *types.MeshEnv { func NewBaseEnv() *types.MeshEnv { if MeshEnv == nil { MeshEnv = &types.MeshEnv{ - Prefix: GetEnvDefault("BlocksMesh_Prefix", "/usr/local/bsm"), RuntimeMode: strings.ToLower(GetEnvDefault("BlocksMesh_RuntimeMode", "dev")), } + + if MeshEnv.RuntimeMode == "dev" { + MeshEnv.Prefix = GetEnvDefault("BlocksMesh_Prefix", utils.GetCurrentPath()) + } else { + MeshEnv.Prefix = GetEnvDefault("BlocksMesh_Prefix", "/usr/local/bsm") + } } return MeshEnv }