mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 12:14:49 +00:00
source: Consolidate if conditions
This commit is contained in:
1 parent
c54df37f6a
commit
b319c18969
1 file changed
+3
-10
+3
-10
@@ -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