Skip to content

Commit

Permalink
Merge pull request #57 from mattn/fix-56
Browse files Browse the repository at this point in the history
Check ${FILES} for Windows workaround
  • Loading branch information
mattn committed Dec 29, 2022
2 parents 3ac055e + 0404d9e commit 7bfe25e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,16 +708,18 @@ func cmdGrep(c *cli.Context) error {
return err
}
defer f.Close()
files, err := f.Readdirnames(-1)
if err != nil || len(files) == 0 {
return err
}
files = filterMarkdown(files)
var args []string
for _, file := range files {
args = append(args, filepath.Join(cfg.MemoDir, file))
if strings.Index(cfg.GrepCmd, "${FILES}") != -1 {
files, err := f.Readdirnames(-1)
if err != nil || len(files) == 0 {
return err
}
files = filterMarkdown(files)
for _, file := range files {
args = append(args, filepath.Join(cfg.MemoDir, file))
}
}
if runtime.GOOS == "windows" {
if runtime.GOOS == "windows" && len(args) > 0 {
pos := 0
for {
next := pos + 20
Expand Down

0 comments on commit 7bfe25e

Please sign in to comment.