projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8169571
)
Do not parse backup files with trailing '~' as templates
author
Anthony Fok
<foka@debian.org>
Tue, 10 Mar 2015 16:18:40 +0000
(10:18 -0600)
committer
Anthony Fok
<foka@debian.org>
Tue, 10 Mar 2015 16:18:40 +0000
(10:18 -0600)
Fixes #964
tpl/template.go
patch
|
blob
|
history
diff --git
a/tpl/template.go
b/tpl/template.go
index 148ec03c346ae5d21327fdb2ba57cc8ea4eb863a..fbe4f32606dfbee9990b2d7c8fba01c4525a474b 100644
(file)
--- a/
tpl/template.go
+++ b/
tpl/template.go
@@
-1230,6
+1230,10
@@
func isDotFile(path string) bool {
return filepath.Base(path)[0] == '.'
}
+func isBackupFile(path string) bool {
+ return path[len(path)-1] == '~'
+}
+
func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
walker := func(path string, fi os.FileInfo, err error) error {
if err != nil {
@@
-1254,7
+1258,7
@@
func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
}
if !fi.IsDir() {
- if isDotFile(path) {
+ if isDotFile(path)
|| isBackupFile(path)
{
return nil
}