From: srinivasreddy Date: Mon, 21 Mar 2016 16:22:27 +0000 (+0530) Subject: source: Consolidate if conditions X-Git-Tag: v0.16~197 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b319c189;p=brevno-suite%2Fhugo source: Consolidate if conditions --- diff --git a/source/filesystem.go b/source/filesystem.go index 66270c58..053081a7 100644 --- a/source/filesystem.go +++ b/source/filesystem.go @@ -143,18 +143,11 @@ func (f *Filesystem) avoid(filePath string) bool { func isNonProcessablePath(filePath string) bool { base := filepath.Base(filePath) - if base[0] == '.' { + if strings.HasPrefix(base, ".") || + strings.HasPrefix(base, "#") || + strings.HasSuffix(base, "~") { return true } - - if base[0] == '#' { - return true - } - - if base[len(base)-1] == '~' { - return true - } - ignoreFiles := viper.GetStringSlice("IgnoreFiles") if len(ignoreFiles) > 0 { for _, ignorePattern := range ignoreFiles {