Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrinivasreddy <thatiparthysreenivas@gmail.com>2016-03-21 19:22:27 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-03-22 21:49:16 +0300
commitb319c1896907332c542b6cebda596ed63aeca9af (patch)
tree56f22a447f0fcb308e0953e8b569ec199fb4d297 /source/filesystem.go
parentc54df37f6a506e035659d15e23372ebcccbefe39 (diff)
source: Consolidate if conditions
Diffstat (limited to 'source/filesystem.go')
-rw-r--r--source/filesystem.go13
1 files changed, 3 insertions, 10 deletions
diff --git a/source/filesystem.go b/source/filesystem.go
index 66270c589..053081a7a 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 {