summaryrefslogtreecommitdiffstats
path: root/source/filesystem.go
diff options
context:
space:
mode:
authorChristoph Burgdorf <christoph.burgdorf@bvsn.org>2014-04-14 23:25:54 +0200
committerspf13 <steve.francia@gmail.com>2014-04-26 23:17:54 -0600
commitf271faea066c47817c8a9a62ef5509a151452d6a (patch)
tree7cc9b65bc37abd021d04a77020dd7896099e97d4 /source/filesystem.go
parent5581e33a34ce852594ba03c3c7f0c067062d1358 (diff)
downloadhugo-f271faea066c47817c8a9a62ef5509a151452d6a.tar.gz
hugo-f271faea066c47817c8a9a62ef5509a151452d6a.zip
Don't process dotfiles
This commit makes it so that not only files but also folders which start with a dot are ignored. Fixes #239
Diffstat (limited to 'source/filesystem.go')
-rw-r--r--source/filesystem.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/filesystem.go b/source/filesystem.go
index abec6ca6e..3a176d7ba 100644
--- a/source/filesystem.go
+++ b/source/filesystem.go
@@ -87,12 +87,12 @@ func (f *Filesystem) captureFiles() {
}
if fi.IsDir() {
- if f.avoid(filePath) {
+ if f.avoid(filePath) || isNonProcessablePath(filePath) {
return filepath.SkipDir
}
return nil
} else {
- if ignoreDotFile(filePath) {
+ if isNonProcessablePath(filePath) {
return nil
}
data, err := ioutil.ReadFile(filePath)
@@ -116,7 +116,7 @@ func (f *Filesystem) avoid(filePath string) bool {
return false
}
-func ignoreDotFile(filePath string) bool {
+func isNonProcessablePath(filePath string) bool {
base := filepath.Base(filePath)
if base[0] == '.' {
return true