mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
Ignore emacs temp files
This commit is contained in:
parent
d44bb4ec05
commit
32d82a4496
2 changed files with 7 additions and 2 deletions
|
@ -745,17 +745,20 @@ func NewWatcher(port int) error {
|
||||||
|
|
||||||
for _, ev := range evs {
|
for _, ev := range evs {
|
||||||
ext := filepath.Ext(ev.Name)
|
ext := filepath.Ext(ev.Name)
|
||||||
|
baseName := filepath.Base(ev.Name)
|
||||||
istemp := strings.HasSuffix(ext, "~") ||
|
istemp := strings.HasSuffix(ext, "~") ||
|
||||||
(ext == ".swp") || // vim
|
(ext == ".swp") || // vim
|
||||||
(ext == ".swx") || // vim
|
(ext == ".swx") || // vim
|
||||||
(ext == ".tmp") || // generic temp file
|
(ext == ".tmp") || // generic temp file
|
||||||
(ext == ".DS_Store") || // OSX Thumbnail
|
(ext == ".DS_Store") || // OSX Thumbnail
|
||||||
filepath.Base(ev.Name) == "4913" || // vim
|
baseName == "4913" || // vim
|
||||||
strings.HasPrefix(ext, ".goutputstream") || // gnome
|
strings.HasPrefix(ext, ".goutputstream") || // gnome
|
||||||
strings.HasSuffix(ext, "jb_old___") || // intelliJ
|
strings.HasSuffix(ext, "jb_old___") || // intelliJ
|
||||||
strings.HasSuffix(ext, "jb_tmp___") || // intelliJ
|
strings.HasSuffix(ext, "jb_tmp___") || // intelliJ
|
||||||
strings.HasSuffix(ext, "jb_bak___") || // intelliJ
|
strings.HasSuffix(ext, "jb_bak___") || // intelliJ
|
||||||
strings.HasPrefix(ext, ".sb-") // byword
|
strings.HasPrefix(ext, ".sb-") || // byword
|
||||||
|
strings.HasPrefix(baseName, ".#") || // emacs
|
||||||
|
strings.HasPrefix(baseName, "#") // emacs
|
||||||
if istemp {
|
if istemp {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,8 @@ func TestIgnoreDotFilesAndDirectories(t *testing.T) {
|
||||||
{"foobar/foo.html", false, []string{"\\.md$", "\\.boo$"}},
|
{"foobar/foo.html", false, []string{"\\.md$", "\\.boo$"}},
|
||||||
{"foobar/foo.md", true, []string{"^foo"}},
|
{"foobar/foo.md", true, []string{"^foo"}},
|
||||||
{"foobar/foo.md", false, []string{"*", "\\.md$", "\\.boo$"}},
|
{"foobar/foo.md", false, []string{"*", "\\.md$", "\\.boo$"}},
|
||||||
|
{"foobar/.#content.md", true, []string{"/\\.#"}},
|
||||||
|
{".#foobar.md", true, []string{"^\\.#"}},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|
Loading…
Reference in a new issue