| 31 | } |
| 32 | |
| 33 | func AskProjectGroups(ask question.Asker, value string, getAllGroupsCallback GetAllGroupsCallback, createProjectGroupCallback CreateProjectGroupCallback) (string, cmd.Dependable, error) { |
| 34 | if value != "" { |
| 35 | return value, nil, nil |
| 36 | } |
| 37 | g, shouldCreateNew, err := selectors.SelectOrNew(ask, "You have not specified a Project group for this project. Please select one:", getAllGroupsCallback, func(pg *projectgroups.ProjectGroup) string { |
| 38 | return pg.Name |
| 39 | }) |
| 40 | if err != nil { |
| 41 | return "", nil, err |
| 42 | } |
| 43 | if shouldCreateNew { |
| 44 | return createProjectGroupCallback() |
| 45 | } |
| 46 | return g.Name, nil, nil |
| 47 | } |