(opts *CreateOptions)
| 124 | } |
| 125 | |
| 126 | func PromptMissing(opts *CreateOptions) ([]cmd.Dependable, error) { |
| 127 | nestedOpts := []cmd.Dependable{} |
| 128 | |
| 129 | question.AskName(opts.Ask, "", "project", &opts.Name.Value) |
| 130 | |
| 131 | if opts.Lifecycle.Value == "" { |
| 132 | lc, err := selectors.Lifecycle("You have not specified a Lifecycle for this project. Please select one:", opts.Client, opts.Ask) |
| 133 | if err != nil { |
| 134 | return nil, err |
| 135 | } |
| 136 | opts.Lifecycle.Value = lc.Name |
| 137 | } |
| 138 | |
| 139 | value, projectGroupOpt, err := projectShared.AskProjectGroups(opts.Ask, opts.Group.Value, opts.GetAllGroupsCallback, opts.CreateProjectGroupCallback) |
| 140 | if err != nil { |
| 141 | return nil, err |
| 142 | } |
| 143 | opts.Group.Value = value |
| 144 | if projectGroupOpt != nil { |
| 145 | nestedOpts = append(nestedOpts, projectGroupOpt) |
| 146 | } |
| 147 | |
| 148 | nestedOpts = append(nestedOpts, opts) |
| 149 | |
| 150 | tagSets, err := opts.GetAllTagsCallback() |
| 151 | if err != nil { |
| 152 | return nil, err |
| 153 | } |
| 154 | |
| 155 | tags, err := selectors.Tags(opts.Ask, []string{}, opts.Tag.Value, tagSets) |
| 156 | if err != nil { |
| 157 | return nil, err |
| 158 | } |
| 159 | opts.Tag.Value = tags |
| 160 | |
| 161 | configAsCodeOpts, err := PromptForConfigAsCode(opts) |
| 162 | opts.ConvertOptions.Project.Value = opts.Name.Value |
| 163 | if err != nil { |
| 164 | return nil, err |
| 165 | } |
| 166 | if configAsCodeOpts != nil { |
| 167 | nestedOpts = append(nestedOpts, configAsCodeOpts) |
| 168 | } |
| 169 | |
| 170 | return nestedOpts, nil |
| 171 | } |
| 172 | |
| 173 | func PromptForConfigAsCode(opts *CreateOptions) (cmd.Dependable, error) { |
| 174 | if !opts.ConfigAsCode.Value { |
no test coverage detected