Skip to content

Commit

Permalink
Add an environment variable function (closes #30)
Browse files Browse the repository at this point in the history
Usage: `{{systemEnv “ENV_VAR_NAME”}}`
  • Loading branch information
jbeemster committed Nov 12, 2015
1 parent f89fdc8 commit b175c21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions run/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ import (
"io/ioutil"
"text/template"
"time"
"os"
)

var (
templFuncs = template.FuncMap{
"nowWithFormat": func(format string) string {
return time.Now().Format(format)
},
"systemEnv": func(env string) string {
return os.Getenv(env)
},
"awsChainCredentials": awsChainCredentials,
"awsEC2RoleCredentials": awsEC2RoleCredentials,
"awsEnvCredentials": awsEnvCredentials,
Expand Down

0 comments on commit b175c21

Please sign in to comment.