MCPcopy Index your code
hub / github.com/dnote/dnote / waitEditorNoteContent

Function waitEditorNoteContent

pkg/cli/cmd/edit/note.go:39–55  ·  view source on GitHub ↗
(ctx context.DnoteCtx, note database.Note)

Source from the content-addressed store, hash-verified

37}
38
39func 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
57func getContent(ctx context.DnoteCtx, note database.Note) (string, error) {
58 if contentFlag != "" {

Callers 1

getContentFunction · 0.85

Calls 2

GetTmpContentPathFunction · 0.92
GetEditorInputFunction · 0.92

Tested by

no test coverage detected