Skip to content

Commit

Permalink
feat: allow custom environment variables (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elara6331 committed May 11, 2023
1 parent c9ebd11 commit baab4c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,15 @@ func (p Plugin) replaceEnv(template string) string {
for i := range templateVars {

// Check if the found var starts with one of our known vars
// or is an environment variable
if strings.Index(matches[1], templateVars[i]) == 0 {
subst, err := envsubst.EvalEnv(s)
if err != nil {
return s
}
return subst
} else if val, ok := os.LookupEnv(matches[1]); ok {
return val
}
}

Expand Down

0 comments on commit baab4c1

Please sign in to comment.