Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
817fc57dd1 | ||
|
|
095ba7820d |
@@ -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
|
||||
|
||||
@@ -4,9 +4,11 @@ import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"local/notes-server/config"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -44,6 +46,9 @@ func (v *Versions) Commit() error {
|
||||
func (v *Versions) cmd(cmd string, args ...string) error {
|
||||
command := exec.Command(cmd, args...)
|
||||
command.Dir = config.Root
|
||||
_, err := command.CombinedOutput()
|
||||
out, err := command.CombinedOutput()
|
||||
if err != nil {
|
||||
log.Println(cmd, args, ":", strings.TrimSpace(string(out)))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user