mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
source: Consolidate if conditions
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
c54df37f6a
commit
b319c18969
@ -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 {
|
||||
|
Reference in New Issue
Block a user