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

Function waitEditorBookName

pkg/cli/cmd/edit/book.go:41–57  ·  view source on GitHub ↗
(ctx context.DnoteCtx)

Source from the content-addressed store, hash-verified

39}
40
41func 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
59func getName(ctx context.DnoteCtx) (string, error) {
60 if nameFlag != "" {

Callers 1

getNameFunction · 0.85

Calls 2

GetTmpContentPathFunction · 0.92
GetEditorInputFunction · 0.92

Tested by

no test coverage detected