diff options
author | Vincent Ambo <tazjin@gmail.com> | 2017-07-13T14·00+0200 |
---|---|---|
committer | Vincent Ambo <tazjin@gmail.com> | 2017-07-13T14·07+0200 |
commit | 5e7bb55e0018fafea01f6e99ff13c52ec33b24af (patch) | |
tree | 11af03fa98f7dc6cdadd498410a39494660949ca | |
parent | 7607f6dc0fff076cc69ca2d6f50eb04b728e3a44 (diff) |
refactor templater: Use resource set 'path' field when loading files
-rw-r--r-- | templater/templater.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/templater/templater.go b/templater/templater.go index 4d9a04eb2d16..4a0c8e7d8d8a 100644 --- a/templater/templater.go +++ b/templater/templater.go @@ -22,6 +22,7 @@ const failOnMissingKeys string = "missingkey=error" type TemplateNotFoundError struct { meep.AllTraits Name string + Path string } // Error that is caused during templating, e.g. required value being absent or invalid template format @@ -64,14 +65,14 @@ func LoadAndApplyTemplates(include *[]string, exclude *[]string, c *context.Cont func processResourceSet(c *context.Context, rs *context.ResourceSet) (*RenderedResourceSet, error) { fmt.Fprintf(os.Stderr, "Loading resources for %s\n", rs.Name) - rp := path.Join(c.BaseDir, rs.Name) + rp := path.Join(c.BaseDir, rs.Path) files, err := ioutil.ReadDir(rp) resources, err := processFiles(c, rs, rp, files) if err != nil { return nil, meep.New( - &TemplateNotFoundError{Name: rs.Name}, + &TemplateNotFoundError{Name: rs.Name, Path: rs.Path}, meep.Cause(err), ) } |