bake listing files not cached in config
This commit is contained in:
16
cmd/dump.go
16
cmd/dump.go
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user