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

Function AskProjectGroups

pkg/cmd/project/shared/shared.go:33–47  ·  view source on GitHub ↗
(ask question.Asker, value string, getAllGroupsCallback GetAllGroupsCallback, createProjectGroupCallback CreateProjectGroupCallback)

Source from the content-addressed store, hash-verified

31}
32
33func 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}

Calls 1

SelectOrNewFunction · 0.92