From: Ask Bjørn Hansen Date: Fri, 28 Feb 2014 05:26:17 +0000 (-0800) Subject: Ignore content files ending in ~ X-Git-Tag: v0.10~4 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e53bc948;p=brevno-suite%2Fhugo Ignore content files ending in ~ Also add *~ to .gitignore --- diff --git a/.gitignore b/.gitignore index df079f25..297d8d81 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ hugo.exe *.swp *.swo .DS_Store +*~ diff --git a/source/filesystem.go b/source/filesystem.go index cefe4a95..96853c8d 100644 --- a/source/filesystem.go +++ b/source/filesystem.go @@ -117,5 +117,14 @@ func (f *Filesystem) avoid(filePath string) bool { } func ignoreDotFile(filePath string) bool { - return filepath.Base(filePath)[0] == '.' + base := filepath.Base(filePath) + if base[0] == '.' { + return true + } + + if base[len(base)-1] == '~' { + return true + } + + return false }