Skip to content

Commit

Permalink
Update program to initialize app template only after having all the s…
Browse files Browse the repository at this point in the history
…ettings.
  • Loading branch information
patrickdappollonio committed Jun 23, 2019
1 parent ad48cab commit 7c71e80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ func main() {
root.Flags().StringVarP(&configs.rawTemplate, "execute", "x", "", "a raw template to execute directly, without providing --file")
root.Flags().BoolVarP(&configs.strictMode, "strict", "s", false, "enables strict mode: if an environment variable in the file is defined but not set, it'll fail")

configs.t = template.New(appName).Funcs(getTemplateFunctions(configs.strictMode))

if err := root.Execute(); err != nil {
os.Exit(1)
}
}

func command(w io.Writer, c conf) error {
c.t = template.New(appName).Funcs(getTemplateFunctions(c.strictMode))

if c.customDelimiters != "" {
l, r, err := getDelimiter(c.customDelimiters)
if err != nil {
Expand Down

0 comments on commit 7c71e80

Please sign in to comment.