diff options
author | Ask Bjørn Hansen <[email protected]> | 2014-02-27 21:26:17 -0800 |
---|---|---|
committer | spf13 <[email protected]> | 2014-02-28 23:23:59 -0500 |
commit | e53bc948a5932805be4b0d29f1d809f7d5938cab (patch) | |
tree | b6c229da16c6c89c7a455f904dae87acb752442b | |
parent | 0becad727a7bda39c4a7df2553b2f7f0939233d1 (diff) | |
download | hugo-e53bc948a5932805be4b0d29f1d809f7d5938cab.tar.gz hugo-e53bc948a5932805be4b0d29f1d809f7d5938cab.zip |
Ignore content files ending in ~
Also add *~ to .gitignore
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | source/filesystem.go | 11 |
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 } |