StorePathsAreInStore a map of store paths to whether they are in the store.
(ctx context.Context, storePaths []string)
| 52 | |
| 53 | // StorePathsAreInStore a map of store paths to whether they are in the store. |
| 54 | func 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 |
| 70 | type LegacyPathInfo struct { |
no test coverage detected