MCPcopy Create free account
hub / github.com/AndroidPoet/playconsole-cli / runGet

Function runGet

cmd/playconsole-cli/commands/tracks/tracks.go:176–201  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

174}
175
176func runGet(cmd *cobra.Command, args []string) error {
177 if err := cli.RequirePackage(cmd); err != nil {
178 return err
179 }
180
181 client, err := api.NewClient(cli.GetPackageName(), 60*time.Second)
182 if err != nil {
183 return err
184 }
185
186 edit, err := client.CreateEdit()
187 if err != nil {
188 return err
189 }
190 defer edit.Close()
191 defer func() {
192 _ = edit.Delete()
193 }()
194
195 track, err := edit.Tracks().Get(client.GetPackageName(), edit.ID(), trackName).Context(edit.Context()).Do()
196 if err != nil {
197 return err
198 }
199
200 return output.Print(track)
201}
202
203func runUpdate(cmd *cobra.Command, args []string) error {
204 if err := cli.RequirePackage(cmd); err != nil {

Callers

nothing calls this directly

Calls 11

CreateEditMethod · 0.95
GetPackageNameMethod · 0.95
RequirePackageFunction · 0.92
NewClientFunction · 0.92
GetPackageNameFunction · 0.92
PrintFunction · 0.92
CloseMethod · 0.80
DeleteMethod · 0.80
TracksMethod · 0.80
IDMethod · 0.80
ContextMethod · 0.45

Tested by

no test coverage detected