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

Function getProject

pkg/cmd/runbook/snapshot/create/create.go:402–416  ·  view source on GitHub ↗
(opts *CreateOptions)

Source from the content-addressed store, hash-verified

400}
401
402func getProject(opts *CreateOptions) (*projects.Project, error) {
403 var project *projects.Project
404 var err error
405 if opts.Project.Value == "" {
406 project, err = selectors.Select(opts.Ask, "Select the project containing the runbook you wish to snapshot:", opts.GetAllProjectsCallback, func(project *projects.Project) string { return project.GetName() })
407 } else {
408 project, err = opts.GetProjectCallback(opts.Project.Value)
409 }
410
411 if project == nil {
412 return nil, errors.New("unable to find project")
413 }
414
415 return project, err
416}
417
418func getRunbook(opts *CreateOptions, project *projects.Project) (*runbooks.Runbook, error) {
419 var runbook *runbooks.Runbook

Callers 1

PromptMissingFunction · 0.70

Calls 2

SelectFunction · 0.92
GetNameMethod · 0.65

Tested by

no test coverage detected