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

Function PromptMissing

pkg/cmd/project/clone/clone.go:124–149  ·  view source on GitHub ↗
(opts *CloneOptions)

Source from the content-addressed store, hash-verified

122}
123
124func PromptMissing(opts *CloneOptions) ([]cmd.Dependable, error) {
125 nestedOpts := []cmd.Dependable{}
126
127 question.AskName(opts.Ask, "", "project", &opts.Name.Value)
128
129 if opts.Lifecycle.Value == "" {
130 lc, err := selectors.Lifecycle("You have not specified a Lifecycle for this project. Please select one:", opts.Client, opts.Ask)
131 if err != nil {
132 return nil, err
133 }
134 opts.Lifecycle.Value = lc.Name
135 }
136
137 value, projectGroupOpt, err := projectShared.AskProjectGroups(opts.Ask, opts.Group.Value, opts.GetAllGroupsCallback, opts.CreateProjectGroupCallback)
138 if err != nil {
139 return nil, err
140 }
141 opts.Group.Value = value
142 if projectGroupOpt != nil {
143 nestedOpts = append(nestedOpts, projectGroupOpt)
144 }
145
146 nestedOpts = append(nestedOpts, opts)
147
148 return nestedOpts, nil
149}
150
151func (co *CloneOptions) Commit() error {
152 sourceProject, err := co.Client.Projects.GetByIdentifier(co.Source.Value)

Callers 1

cloneRunFunction · 0.70

Calls 2

AskNameFunction · 0.92
LifecycleFunction · 0.92

Tested by

no test coverage detected