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

Function PromptMissing

pkg/cmd/buildinformation/upload/upload.go:168–205  ·  view source on GitHub ↗
(opts *UploadOptions)

Source from the content-addressed store, hash-verified

166}
167
168func PromptMissing(opts *UploadOptions) error {
169 if len(opts.PackageId.Value) == 0 {
170 var packageIdString string
171 if err := opts.Ask(&survey.Multiline{
172 Message: "Package ID(s)",
173 Help: "A multi-line list of Package IDs.",
174 }, &packageIdString, survey.WithValidator(survey.ComposeValidators(
175 survey.Required,
176 ))); err != nil {
177 return err
178 }
179 opts.PackageId.Value = strings.Split(packageIdString, "\n")
180 }
181
182 if opts.Version.Value == "" {
183 if err := opts.Ask(&survey.Input{
184 Message: "Version",
185 Help: "The version of the package.",
186 }, &opts.Version.Value, survey.WithValidator(survey.ComposeValidators(
187 survey.Required,
188 ))); err != nil {
189 return err
190 }
191 }
192
193 if opts.File.Value == "" {
194 if err := opts.Ask(&survey.Input{
195 Message: "Build information file",
196 Help: "Octopus Build Information JSON file.",
197 }, &opts.File.Value, survey.WithValidator(survey.ComposeValidators(
198 survey.Required,
199 ))); err != nil {
200 return err
201 }
202 }
203
204 return nil
205}

Callers 1

uploadRunFunction · 0.70

Calls 1

AskMethod · 0.65

Tested by

no test coverage detected