From f77fc4ef5f2df96c6bba3cd6c7d88a77d61a5a80 Mon Sep 17 00:00:00 2001 From: ewy Date: Tue, 2 Jun 2026 15:07:59 +0200 Subject: add .wants and .includes .wants adds potential out-of-tree sources to your state (for monorepos, for example) .includes adds targets from another source to this one, adding inheritance --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 496d09b..89d90e6 100644 --- a/main.go +++ b/main.go @@ -148,9 +148,9 @@ func pik() spool.ExitCode { var st *model.State var stateErrors []error - var c *cache.Cache + var c cache.Cache if !*flags.All { - st, stateErrors = model.NewState(fs, locs, indexers, runners) + st, stateErrors = model.NewState(fs, locs, pikdex.Indexer.Data, indexers, runners) go func() { if len(stateErrors) > 0 { return @@ -162,12 +162,12 @@ func pik() spool.ExitCode { }() } else { - c, err = cache.LoadFile(fs, paths.ContextsFile.String()[1:]) + c, err = cache.Get() if err != nil { _, _ = spool.Warn("%v\n", err) return spool.CacheReadFailure } - st, stateErrors = cache.LoadState(fs, c, indexers, runners) + st, stateErrors = cache.LoadState(fs, pikdex.Indexer.Data, c, indexers, runners) } if stateErrors != nil { _, _ = spool.Warn("%v\n", stateErrors) @@ -212,7 +212,7 @@ func pik() spool.ExitCode { // TODO: Move auto-all logic into Search? if !*flags.All && result.Target == nil && len(result.Args) > 0 && SourcesWithoutResults == nil && !ForceConfirm { ForceConfirm = true - SourcesWithoutResults = c + SourcesWithoutResults = &c return pik() } -- cgit v1.3.1