Skip to content
Snippets Groups Projects
Commit 4b4f000c authored by Johan de Klerk's avatar Johan de Klerk
Browse files

Send in default env for CurrentEnv function

parent 0ab56347
Branches
Tags v0.16.0
No related merge requests found
...@@ -121,7 +121,7 @@ func CurrentBasePath() string { ...@@ -121,7 +121,7 @@ func CurrentBasePath() string {
return base return base
} }
func CurrentEnv() string { func CurrentEnv(defaultEnv ...string) string {
// Get env from CI commit branch // Get env from CI commit branch
env := os.Getenv("CI_COMMIT_BRANCH") env := os.Getenv("CI_COMMIT_BRANCH")
...@@ -142,8 +142,13 @@ func CurrentEnv() string { ...@@ -142,8 +142,13 @@ func CurrentEnv() string {
} }
if env != "dev" && env != "stage" && env != "qa" && env != "sandbox" && env != "prod" && env != "playground" { if env != "dev" && env != "stage" && env != "qa" && env != "sandbox" && env != "prod" && env != "playground" {
if defaultEnv != nil && len(defaultEnv) > 0 {
forcedEnv := defaultEnv[0]
env = forcedEnv
} else {
env = "dev" env = "dev"
} }
}
return env return env
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment