bake listing files not cached in config

This commit is contained in:
Bel LaPointe
2023-11-06 12:25:52 -07:00
parent 8dacd8da5d
commit d36f9e74b3
4 changed files with 56 additions and 20 deletions

View File

@@ -6,6 +6,7 @@ import (
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"gogs.inhome.blapointe.com/bel/pttodo/pttodo"
@@ -13,12 +14,25 @@ import (
)
func dump(config config) error {
return _dump(os.Stdout, config.targets, config.tags, config.search, config.root)
return _dump(os.Stdout, config.Targets(), config.tags, config.search, config.root)
}
func _dump(writer io.Writer, filepaths []string, tags []string, search, rootDisplay string) error {
var root pttodo.Root
for _, p := range filepaths {
results, err := filepath.Glob(p + ".*")
if err != nil {
return err
}
for _, result := range results {
if result == p {
continue
}
filepaths = append(filepaths, result)
}
}
for _, filepath := range filepaths {
reader, err := filePathReader(filepath)
if err != nil {