commit bee59dc3b7716c75ba13efb16058ace591c81ab3
parent ef730963ae12f3f09cf66f33d94b7b91db6e318a
Author: gearsix <gearsix@tuta.io>
Date: Thu, 2 Sep 2021 00:50:36 +0100
added .ignore support for template files
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/template.go b/template.go
@@ -41,11 +41,14 @@ func LoadTemplateDir(dir string) ([]suti.Template, error) {
} else {
err = nil
for _, t := range tpaths {
+ if filepath.Ext(t) == ".ignore" {
+ continue
+ }
paths[t] = make([]string, 0)
dir, file := filepath.Split(t)
ppath := filepath.Join(dir, strings.TrimSuffix(file, filepath.Ext(file)))
for _, p := range tpaths {
- if strings.Contains(p, ppath) && p != t {
+ if !strings.Contains(p, ".ignore") && strings.Contains(p, ppath) && p != t {
paths[t] = append(paths[t], p)
}
}