| 166 | } |
| 167 | |
| 168 | func 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 | } |