mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 15:21:27 +00:00
source: Consolidate if conditions
This commit is contained in:
parent
c54df37f6a
commit
b319c18969
1 changed files with 3 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue