MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / PromptForEnvironments

Function PromptForEnvironments

pkg/cmd/tenant/variables/update/update.go:449–459  ·  view source on GitHub ↗
(opts *UpdateOptions)

Source from the content-addressed store, hash-verified

447}
448
449func PromptForEnvironments(opts *UpdateOptions) error {
450 if len(opts.Environments.Value) == 0 {
451 selectedEnvironments, err := selectors.EnvironmentsMultiSelect(opts.Ask, opts.GetAllEnvironmentsCallback, "You have not specified an environment. Select a scope or leave empty to update an unscoped variable", false)
452 if err != nil {
453 return err
454 }
455
456 opts.Environments.Value = util.SliceTransform(selectedEnvironments, func(e *environments.Environment) string { return e.ID })
457 }
458 return nil
459}
460
461func PromptForVariableV1(opts *UpdateOptions, tenantVariables *variables.TenantVariables, variableFilter func(opts *UpdateOptions, tenantVariables *variables.TenantVariables) []*PossibleVariable) (*PossibleVariable, error) {
462 possibleVariables := variableFilter(opts, tenantVariables)

Callers 1

PromptMissingFunction · 0.85

Calls 2

EnvironmentsMultiSelectFunction · 0.92
SliceTransformFunction · 0.92

Tested by

no test coverage detected