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
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ func CurrentBasePath() string {
return base
}
func CurrentEnv() string {
func CurrentEnv(defaultEnv ...string) string {
// Get env from CI commit branch
env := os.Getenv("CI_COMMIT_BRANCH")
......@@ -142,8 +142,13 @@ func CurrentEnv() string {
}
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"
}
}
return env
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment