summaryrefslogtreecommitdiff
path: root/model/new.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/new.go')
-rw-r--r--model/new.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/model/new.go b/model/new.go
index f26bc8f..41086c2 100644
--- a/model/new.go
+++ b/model/new.go
@@ -7,7 +7,8 @@ import (
"strings"
)
-func NewState(f fs.FS, locations []string, indexers []Indexer, runners []Runner) (*State, error) {
+func NewState(f fs.FS, locations []string, indexers []Indexer, runners []Runner) (*State, []error) {
+ var errs []error
st := &State{}
for _, loc := range locations {
_, dirName := filepath.Split(loc)
@@ -26,11 +27,13 @@ func NewState(f fs.FS, locations []string, indexers []Indexer, runners []Runner)
s, err := fs.Sub(f, loc)
if err != nil {
- return nil, err
+ errs = append(errs, err)
+ continue
}
targets, err := indexer.Index("/"+loc, s, runners)
if err != nil {
- return nil, err
+ errs = append(errs, err)
+ continue
}
src.Targets = append(src.Targets, targets...)
}
@@ -41,5 +44,5 @@ func NewState(f fs.FS, locations []string, indexers []Indexer, runners []Runner)
}
- return st, nil
+ return st, errs
}