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

Function runList

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

Source from the content-addressed store, hash-verified

47}
48
49func runList(cmd *cobra.Command, args []string) error {
50 var apps []AppInfo
51
52 err := api.CheckAndEnableAPI(func() error {
53 result, err := fetchApps()
54 if err != nil {
55 return err
56 }
57 apps = result
58 return nil
59 })
60
61 if err != nil {
62 return err
63 }
64
65 if len(apps) == 0 {
66 output.PrintInfo("No apps found. Make sure your service account has access to apps in Play Console.")
67 return output.Print([]AppInfo{})
68 }
69
70 return output.Print(apps)
71}
72
73func fetchApps() ([]AppInfo, error) {
74 ctx, cancel := context.WithTimeout(context.Background(), cli.ResolveTimeout(60*time.Second))

Callers

nothing calls this directly

Calls 4

CheckAndEnableAPIFunction · 0.92
PrintInfoFunction · 0.92
PrintFunction · 0.92
fetchAppsFunction · 0.85

Tested by

no test coverage detected