about summary refs log tree commit diff
path: root/templater
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-10-27T00·37+0200
committerVincent Ambo <tazjin@gmail.com>2017-10-27T00·55+0200
commit9cffd3d1d40e90844394011898f6dd820f7805b7 (patch)
treeaf90f6125a071fb3915ceb271d62ae063c86a859 /templater
parent2574942338d5fda9dc3beb46dfc600707189de3d (diff)
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
Diffstat (limited to 'templater')
-rw-r--r--templater/templater.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/templater/templater.go b/templater/templater.go
index c9260abc2111..bb1f8c2eed39 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)