summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsk Bjørn Hansen <ask@develooper.com>2014-02-27 21:26:17 -0800
committerspf13 <steve.francia@gmail.com>2014-02-28 23:23:59 -0500
commite53bc948a5932805be4b0d29f1d809f7d5938cab (patch)
treeb6c229da16c6c89c7a455f904dae87acb752442b
parent0becad727a7bda39c4a7df2553b2f7f0939233d1 (diff)
Ignore content files ending in ~
Also add *~ to .gitignore
-rw-r--r--.gitignore1
-rw-r--r--source/filesystem.go11
2 files changed, 11 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index df079f250..297d8d815 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 cefe4a950..96853c8dd 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
}