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

Function PromptMissing

pkg/cmd/workerpool/dynamic/create/create.go:119–142  ·  view source on GitHub ↗
(opts *CreateOptions)

Source from the content-addressed store, hash-verified

117}
118
119func PromptMissing(opts *CreateOptions) error {
120 err := question.AskName(opts.Ask, "", "Dynamic Worker Pool", &opts.Name.Value)
121 if err != nil {
122 return err
123 }
124
125 err = question.AskDescription(opts.Ask, "", "Dynamic Worker Pool", &opts.Description.Value)
126 if err != nil {
127 return err
128 }
129
130 if opts.Type.Value == "" {
131 selectedOption, err := selectors.Select(opts.Ask, "Select the worker type to use", opts.GetDynamicWorkerPoolTypes, func(p *workerpools.DynamicWorkerPoolType) string {
132 return fmt.Sprintf("%s (%s)", p.Description, p.Type)
133 })
134 if err != nil {
135 return err
136 }
137
138 opts.Type.Value = selectedOption.ID
139 }
140
141 return nil
142}

Callers 3

createRunFunction · 0.70

Calls 3

AskNameFunction · 0.92
AskDescriptionFunction · 0.92
SelectFunction · 0.92

Tested by 2