(ctx context.DnoteCtx, note database.Note)
| 37 | } |
| 38 | |
| 39 | func waitEditorNoteContent(ctx context.DnoteCtx, note database.Note) (string, error) { |
| 40 | fpath, err := ui.GetTmpContentPath(ctx) |
| 41 | if err != nil { |
| 42 | return "", errors.Wrap(err, "getting temporarily content file path") |
| 43 | } |
| 44 | |
| 45 | if err := os.WriteFile(fpath, []byte(note.Body), 0644); err != nil { |
| 46 | return "", errors.Wrap(err, "preparing tmp content file") |
| 47 | } |
| 48 | |
| 49 | c, err := ui.GetEditorInput(ctx, fpath) |
| 50 | if err != nil { |
| 51 | return "", errors.Wrap(err, "getting editor input") |
| 52 | } |
| 53 | |
| 54 | return c, nil |
| 55 | } |
| 56 | |
| 57 | func getContent(ctx context.DnoteCtx, note database.Note) (string, error) { |
| 58 | if contentFlag != "" { |
no test coverage detected