From 9cffd3d1d40e90844394011898f6dd820f7805b7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 27 Oct 2017 02:37:28 +0200 Subject: [PATCH] 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 --- templater/templater.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templater/templater.go b/templater/templater.go index c9260abc2..bb1f8c2ee 100644 --- a/templater/templater.go +++ b/templater/templater.go @@ -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)