mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02: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 {
|
func isNonProcessablePath(filePath string) bool {
|
||||||
base := filepath.Base(filePath)
|
base := filepath.Base(filePath)
|
||||||
if base[0] == '.' {
|
if strings.HasPrefix(base, ".") ||
|
||||||
|
strings.HasPrefix(base, "#") ||
|
||||||
|
strings.HasSuffix(base, "~") {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if base[0] == '#' {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if base[len(base)-1] == '~' {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
ignoreFiles := viper.GetStringSlice("IgnoreFiles")
|
ignoreFiles := viper.GetStringSlice("IgnoreFiles")
|
||||||
if len(ignoreFiles) > 0 {
|
if len(ignoreFiles) > 0 {
|
||||||
for _, ignorePattern := range ignoreFiles {
|
for _, ignorePattern := range ignoreFiles {
|
||||||
|
Reference in New Issue
Block a user