| 122 | } |
| 123 | |
| 124 | func 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 | |
| 151 | func (co *CloneOptions) Commit() error { |
| 152 | sourceProject, err := co.Client.Projects.GetByIdentifier(co.Source.Value) |