mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-26 03:01:52 +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 {
|
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 {
|
||||||
|
|
Loading…
Reference in a new issue