mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 16:14:59 +00:00
Ignore content files ending in ~
Also add *~ to .gitignore
This commit is contained in:
1 parent
0becad727a
commit
e53bc948a5
2 files changed
+11
-1
No files matched your search
@@ -4,3 +4,4 @@ hugo.exe
|
|||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
*~
|
||||||
+10
-1
@@ -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
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user