(opts *UpdateOptions, variables *variables.TenantVariables)
| 422 | } |
| 423 | |
| 424 | func PromptForEnvironmentV1(opts *UpdateOptions, variables *variables.TenantVariables) error { |
| 425 | if len(opts.Environments.Value) == 0 { |
| 426 | var environmentSelections []*selectors.SelectOption[string] |
| 427 | environmentMap, err := getEnvironmentMap(opts.GetAllEnvironmentsCallback) |
| 428 | if err != nil { |
| 429 | return err |
| 430 | } |
| 431 | |
| 432 | for _, p := range variables.ProjectVariables { |
| 433 | if strings.EqualFold(p.ProjectName, opts.Project.Value) { |
| 434 | for k, _ := range p.Variables { |
| 435 | environmentSelections = append(environmentSelections, selectors.NewSelectOption[string](environmentMap[k], environmentMap[k])) |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | selectedEnvironment, err := selectors.SelectOptions(opts.Ask, "You have not specified an environment", func() []*selectors.SelectOption[string] { return environmentSelections }) |
| 441 | if err != nil { |
| 442 | return err |
| 443 | } |
| 444 | opts.Environments.Value = append(opts.Environments.Value, selectedEnvironment.Value) |
| 445 | } |
| 446 | return nil |
| 447 | } |
| 448 | |
| 449 | func PromptForEnvironments(opts *UpdateOptions) error { |
| 450 | if len(opts.Environments.Value) == 0 { |
no test coverage detected