MCPcopy Index your code
hub / github.com/jetify-com/devbox / StorePathsAreInStore

Function StorePathsAreInStore

internal/nix/store.go:54–67  ·  view source on GitHub ↗

StorePathsAreInStore a map of store paths to whether they are in the store.

(ctx context.Context, storePaths []string)

Source from the content-addressed store, hash-verified

52
53// StorePathsAreInStore a map of store paths to whether they are in the store.
54func StorePathsAreInStore(ctx context.Context, storePaths []string) (map[string]bool, error) {
55 defer debug.FunctionTimer().End()
56 if len(storePaths) == 0 {
57 return map[string]bool{}, nil
58 }
59 cmd := Command("path-info", "--offline", "--json")
60 cmd.Args = appendArgs(cmd.Args, storePaths)
61 output, err := cmd.Output(ctx)
62 if err != nil {
63 return nil, err
64 }
65
66 return parseStorePathFromInstallableOutput(output)
67}
68
69// Older nix versions (like 2.17) are an array of objects that contain path and valid fields
70type LegacyPathInfo struct {

Callers 1

Calls 6

FunctionTimerFunction · 0.92
appendArgsFunction · 0.85
EndMethod · 0.80
CommandFunction · 0.70
OutputMethod · 0.45

Tested by

no test coverage detected