aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-02-19 14:06:57 +0100
committerRobin Jarry <robin@jarry.cc>2022-02-19 15:24:55 +0100
commitbb0f1801402e98266d2554a5f002dc8ce0419808 (patch)
treef1100f9abb31293895b58ce7522ebe73e5262073 /lib
parent05ad96a30cb8ea17970c84ea7c72f8f3def5afa5 (diff)
downloadaerc-bb0f1801402e98266d2554a5f002dc8ce0419808.tar.gz
config: do not hardcode sharedir
Instead of using a static SHAREDIR at compile time, use a list of standard paths to use at runtime for templates, config files and stylesets. This implies removing all default filters in the default configuration. Replace them with basic commands. New users can configure the filters as they wish. Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/templates/template.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/templates/template.go b/lib/templates/template.go
index 6d66d8eb..9c71c463 100644
--- a/lib/templates/template.go
+++ b/lib/templates/template.go
@@ -227,3 +227,11 @@ func ParseTemplateFromFile(templateName string, templateDirs []string, data inte
}
return &body, nil
}
+
+func CheckTemplate(templateName string, templateDirs []string) error {
+ if templateName != "" {
+ _, err := ParseTemplateFromFile(templateName, templateDirs, DummyData())
+ return err
+ }
+ return nil
+}