From 370f13b58e9cb74eeab3461afb779cf4d013c94b Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 14 Apr 2026 18:58:37 +0200 Subject: handle not having stuff installed a little more gracefully --- model/new.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'model/new.go') 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 } -- cgit v1.3