| 166 | } |
| 167 | |
| 168 | func PromptMissing(opts *NuPkgCreateOptions) error { |
| 169 | if len(opts.Author.Value) == 0 { |
| 170 | for { |
| 171 | author := "" |
| 172 | if err := opts.Ask(&survey.Input{ |
| 173 | Message: "Author (leave blank to continue)", |
| 174 | Help: "Add an author to the package metadata.", |
| 175 | }, &author); err != nil { |
| 176 | return err |
| 177 | } |
| 178 | if strings.TrimSpace(author) == "" { |
| 179 | break |
| 180 | } |
| 181 | opts.Author.Value = append(opts.Author.Value, author) |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | if len(opts.Author.Value) > 0 { |
| 186 | if opts.Title.Value == "" { |
| 187 | if err := opts.Ask(&survey.Input{ |
| 188 | Message: "Nuspec title", |
| 189 | Help: "The title to include in the Nuspec file.", |
| 190 | }, &opts.Title.Value); err != nil { |
| 191 | return err |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | if opts.Description.Value == "" { |
| 196 | if err := opts.Ask(&survey.Input{ |
| 197 | Message: "Nuspec description", |
| 198 | Help: "The description to include in the Nuspec file.", |
| 199 | Default: "A deployment package created from files on disk.", |
| 200 | }, &opts.Description.Value); err != nil { |
| 201 | return err |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | if opts.ReleaseNotes.Value == "" { |
| 206 | if err := opts.Ask(&surveyext.OctoEditor{ |
| 207 | Editor: &survey.Editor{ |
| 208 | Message: "Nuspec release notes", |
| 209 | Help: "The release notes to include in the Nuspec file.", |
| 210 | }, |
| 211 | Optional: true, |
| 212 | }, &opts.ReleaseNotes.Value); err != nil { |
| 213 | return err |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | if opts.ReleaseNotesFile.Value == "" { |
| 218 | if err := opts.Ask(&survey.Input{ |
| 219 | Message: "Nuspec release notes file", |
| 220 | Help: "A path to a release notes file whose contents will be included in the Nuspec file's release notes.", |
| 221 | }, &opts.ReleaseNotesFile.Value); err != nil { |
| 222 | return err |
| 223 | } |
| 224 | } |
| 225 | } |