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

Function createRun

pkg/cmd/tenant/create/create.go:60–96  ·  view source on GitHub ↗
(opts *CreateOptions)

Source from the content-addressed store, hash-verified

58}
59
60func createRun(opts *CreateOptions) error {
61 var optsArray []cmd.Dependable
62 var err error
63 if !opts.NoPrompt {
64 optsArray, err = PromptMissing(opts)
65 if err != nil {
66 return err
67 }
68 } else {
69 // Validate tags when running with --no-prompt
70 if len(opts.Tag.Value) > 0 {
71 tagSets, err := opts.GetAllTagsCallback()
72 if err != nil {
73 return err
74 }
75 if err := selectors.ValidateTags(opts.Tag.Value, tagSets); err != nil {
76 return err
77 }
78 }
79 optsArray = append(optsArray, opts)
80 }
81
82 for _, o := range optsArray {
83 if err := o.Commit(); err != nil {
84 return err
85 }
86 }
87
88 if !opts.NoPrompt {
89 fmt.Fprintln(opts.Out, "\nAutomation Commands:")
90 for _, o := range optsArray {
91 o.GenerateAutomationCmd()
92 }
93 }
94
95 return nil
96}
97
98func PromptMissing(opts *CreateOptions) ([]cmd.Dependable, error) {
99 nestedOpts := []cmd.Dependable{}

Callers 1

NewCmdCreateFunction · 0.70

Calls 4

ValidateTagsFunction · 0.92
PromptMissingFunction · 0.70
CommitMethod · 0.65
GenerateAutomationCmdMethod · 0.65

Tested by

no test coverage detected