(ctx context.DnoteCtx)
| 39 | } |
| 40 | |
| 41 | func waitEditorBookName(ctx context.DnoteCtx) (string, error) { |
| 42 | fpath, err := ui.GetTmpContentPath(ctx) |
| 43 | if err != nil { |
| 44 | return "", errors.Wrap(err, "getting temporarily content file path") |
| 45 | } |
| 46 | |
| 47 | c, err := ui.GetEditorInput(ctx, fpath) |
| 48 | if err != nil { |
| 49 | return "", errors.Wrap(err, "getting editor input") |
| 50 | } |
| 51 | |
| 52 | // remove the newline at the end because files end with linebreaks in POSIX |
| 53 | c = strings.TrimSuffix(c, "\n") |
| 54 | c = strings.TrimSuffix(c, "\r\n") |
| 55 | |
| 56 | return c, nil |
| 57 | } |
| 58 | |
| 59 | func getName(ctx context.DnoteCtx) (string, error) { |
| 60 | if nameFlag != "" { |
no test coverage detected