From a2e0d0382ca46a7564581fed0e3fbfc4093b08fb Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Tue, 3 Jul 2018 14:10:22 -0400 Subject: [PATCH] ignore emacs temporary files and fix ignoring of dotfiles --- scripts/continuserv/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/continuserv/main.go b/scripts/continuserv/main.go index 330ddca73..21effdfd4 100644 --- a/scripts/continuserv/main.go +++ b/scripts/continuserv/main.go @@ -120,8 +120,11 @@ func filter(e fsnotify.Event) bool { return false } - // Avoid some temp files that vim writes - if strings.HasSuffix(e.Name, "~") || strings.HasSuffix(e.Name, ".swp") || strings.HasPrefix(e.Name, ".") { + _, fname := filepath.Split(e.Name) + + // Avoid some temp files that vim or emacs writes + if strings.HasSuffix(e.Name, "~") || strings.HasSuffix(e.Name, ".swp") || strings.HasPrefix(fname, ".") || + (strings.HasPrefix(fname, "#") && strings.HasSuffix(fname, "#")) { return false }