refactor templater: Add explicit note about empty-rs warnings

Due to an interesting combination of an error not being handled and Go
initialising everything with what it thinks should be the default,
non-existent resource sets have been gracefully handled already.

This makes this accidental fix explicit.

Fixes #90
This commit is contained in:
Vincent Ambo 2017-10-27 02:37:28 +02:00
parent 2574942338
commit 9cffd3d1d4

View file

@ -66,7 +66,10 @@ func processResourceSet(c *context.Context, rs *context.ResourceSet) (*RenderedR
fmt.Fprintf(os.Stderr, "Loading resources for %s\n", rs.Name)
rp := path.Join(c.BaseDir, rs.Path)
files, err := ioutil.ReadDir(rp)
// Explicitly discard this error, which will give us an empty list of files instead.
// This will end up printing a warning to the user, but it won't stop the rest of the process.
files, _ := ioutil.ReadDir(rp)
resources, err := processFiles(c, rs, rp, files)