(ctx context.Context, rep repo.Repository)
| 120 | } |
| 121 | |
| 122 | func (c *commandSnapshotList) run(ctx context.Context, rep repo.Repository) error { |
| 123 | tags, err := getTags(c.snapshotListTags) |
| 124 | if err != nil { |
| 125 | return err |
| 126 | } |
| 127 | |
| 128 | manifestIDs, fullPath, err := findManifestIDs(ctx, rep, c.snapshotListPath, tags) |
| 129 | if err != nil { |
| 130 | return err |
| 131 | } |
| 132 | |
| 133 | manifests, err := snapshot.LoadSnapshots(ctx, rep, manifestIDs) |
| 134 | if err != nil { |
| 135 | return errors.Wrap(err, "unable to load snapshots") |
| 136 | } |
| 137 | |
| 138 | if c.jo.jsonOutput { |
| 139 | return c.outputJSON(ctx, rep, manifests) |
| 140 | } |
| 141 | |
| 142 | return c.outputManifestGroups(ctx, rep, manifests, fullPath) |
| 143 | } |
| 144 | |
| 145 | // SnapshotManifest defines the JSON output for the CLI snapshot commands. |
| 146 | type SnapshotManifest struct { |
nothing calls this directly
no test coverage detected