(cmd *cobra.Command, args []string)
| 47 | } |
| 48 | |
| 49 | func 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 | |
| 73 | func fetchApps() ([]AppInfo, error) { |
| 74 | ctx, cancel := context.WithTimeout(context.Background(), cli.ResolveTimeout(60*time.Second)) |
nothing calls this directly
no test coverage detected