(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface)
| 186 | } |
| 187 | |
| 188 | func runEdit(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error { |
| 189 | commentID, err := resolveCommentID(opts, c, baseRepo) |
| 190 | if err != nil { |
| 191 | return err |
| 192 | } |
| 193 | |
| 194 | existing, err := c.GetComment(baseRepo.RepoHost(), commentID) |
| 195 | if err != nil { |
| 196 | return err |
| 197 | } |
| 198 | |
| 199 | body, err := resolveBody(opts, existing.Body) |
| 200 | if err != nil { |
| 201 | return err |
| 202 | } |
| 203 | |
| 204 | opts.IO.StartProgressIndicator() |
| 205 | comment, err := c.UpdateComment(baseRepo, commentID, body) |
| 206 | opts.IO.StopProgressIndicator() |
| 207 | if err != nil { |
| 208 | return err |
| 209 | } |
| 210 | |
| 211 | fmt.Fprintln(opts.IO.Out, comment.URL) |
| 212 | return nil |
| 213 | } |
| 214 | |
| 215 | func runReply(opts *CommentOptions, c client.DiscussionClient, baseRepo ghrepo.Interface) error { |
| 216 | commentID, err := resolveCommentID(opts, c, baseRepo) |
no test coverage detected