dont search attachments or git

master v1.16
Bel LaPointe 2021-02-25 22:23:13 -06:00
parent 095ba7820d
commit 817fc57dd1
1 changed files with 6 additions and 0 deletions

View File

@ -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