更新 env/env.go

This commit is contained in:
yanweidong 2024-10-03 20:39:18 +08:00
parent d645a49c97
commit 9bb2a1d730
1 changed files with 6 additions and 1 deletions

7
env/env.go vendored
View File

@ -32,9 +32,14 @@ func NewEnv() *types.MeshEnv {
func NewBaseEnv() *types.MeshEnv { func NewBaseEnv() *types.MeshEnv {
if MeshEnv == nil { if MeshEnv == nil {
MeshEnv = &types.MeshEnv{ MeshEnv = &types.MeshEnv{
Prefix: GetEnvDefault("BlocksMesh_Prefix", "/usr/local/bsm"),
RuntimeMode: strings.ToLower(GetEnvDefault("BlocksMesh_RuntimeMode", "dev")), 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 return MeshEnv
} }