From 817fc57dd1bda2cc06c84c1a5a801680b32bfb38 Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Thu, 25 Feb 2021 22:23:13 -0600 Subject: [PATCH] dont search attachments or git --- notes/search.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/notes/search.go b/notes/search.go index 0bf1fba..4d45f77 100755 --- a/notes/search.go +++ b/notes/search.go @@ -81,6 +81,12 @@ func (n *Notes) Search(phrase string) (string, error) { } func grepFile(file string, searcher *searcher) (bool, error) { + if d := path.Base(path.Dir(file)); strings.HasPrefix(d, ".") && strings.HasSuffix(d, ".attachments") { + return false, nil + } + if strings.Contains(file, "/.git/") { + return false, nil + } f, err := os.Open(file) if err != nil { return false, err