Skip to content

Commit

Permalink
Merge pull request #68 from mittwald/fix-template-rendering
Browse files Browse the repository at this point in the history
don't use parseFiles on existing template
  • Loading branch information
hensur authored Nov 15, 2023
2 parents b6f2512 + 20c36c7 commit d736758
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/files/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@ func renderFile(cfg *config.File) error {

log.Infof("creating configuration file %s from template %s", cfg.Target, cfg.Template)

tpl, err := newTemplate(cfg.Target).ParseFiles(cfg.Template)
tplContents, err := os.ReadFile(cfg.Template)
if err != nil {
return err
}

tpl, err := template.New(cfg.Target).Parse(string(tplContents))
folderPath, err := filepath.Abs(filepath.Dir(cfg.Target))
if err != nil {
return err
Expand Down

0 comments on commit d736758

Please sign in to comment.