mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Ignore content files ending in ~
Also add *~ to .gitignore
This commit is contained in:
parent
0becad727a
commit
e53bc948a5
2 changed files with 11 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@ hugo.exe
|
||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*~
|
||||||
|
|
|
@ -117,5 +117,14 @@ func (f *Filesystem) avoid(filePath string) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func ignoreDotFile(filePath string) bool {
|
func ignoreDotFile(filePath string) bool {
|
||||||
return filepath.Base(filePath)[0] == '.'
|
base := filepath.Base(filePath)
|
||||||
|
if base[0] == '.' {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if base[len(base)-1] == '~' {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue