| 353 | } |
| 354 | |
| 355 | func resolveRuntimeClient(runtime *app.Runtime, email string, override string) (string, error) { |
| 356 | if err := configureRuntimeConfig(runtime); err != nil { |
| 357 | return "", err |
| 358 | } |
| 359 | cfg, err := runtime.Config.Read() |
| 360 | if err != nil { |
| 361 | return "", err |
| 362 | } |
| 363 | |
| 364 | return config.ResolveClientForAccountWithCredentials(cfg, email, override, func(client string) (bool, error) { |
| 365 | if err := configureRuntimeLayout(runtime, config.PathKindConfig, config.PathKindData); err != nil { |
| 366 | return false, err |
| 367 | } |
| 368 | files := config.NewClientCredentialsStore(runtime.Layout) |
| 369 | _, exists, err := files.ExistingPath(client) |
| 370 | return exists, err |
| 371 | }) |
| 372 | } |
| 373 | |
| 374 | func commandIO(ctx context.Context) app.IO { |
| 375 | commandIO := newDefaultRuntime().IO |