diff options
author | bep <bjorn.erik.pedersen@gmail.com> | 2015-06-03 18:54:30 +0200 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-06-03 18:54:15 +0200 |
commit | beeae6ab69b0cbb4daba7a1044308bd157df77ab (patch) | |
tree | 410482d3812a80e56d486b6c8b07ef05fb954a6c /source/filesystem.go | |
parent | beaa1b3aad578ebbbdf426321ed1758eb1068946 (diff) | |
download | hugo-beeae6ab69b0cbb4daba7a1044308bd157df77ab.tar.gz hugo-beeae6ab69b0cbb4daba7a1044308bd157df77ab.zip |
Add some tests for IgnoreFiles
And log error on invalid regexp.
See #1189
Diffstat (limited to 'source/filesystem.go')
-rw-r--r-- | source/filesystem.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/filesystem.go b/source/filesystem.go index 7242d1dfc..7b7ebb6b7 100644 --- a/source/filesystem.go +++ b/source/filesystem.go @@ -151,8 +151,11 @@ func isNonProcessablePath(filePath string) bool { ignoreFiles := viper.GetStringSlice("IgnoreFiles") if len(ignoreFiles) > 0 { for _, ignorePattern := range ignoreFiles { - match, _ := regexp.MatchString(ignorePattern, filePath) - if match { + match, err := regexp.MatchString(ignorePattern, filePath) + if err != nil { + helpers.DistinctErrorLog.Printf("Invalid regexp '%s' in ignoreFiles: %s", ignorePattern, err) + return false + } else if match { return true } } |