MCPcopy Create free account
hub / github.com/cli/cli / ReadMarkdownBodyFile

Function ReadMarkdownBodyFile

pkg/cmdutil/file_input.go:22–31  ·  view source on GitHub ↗

ReadMarkdownBodyFile reads Markdown from path and returns its base directory for resolving local attachment references. Standard input has no base directory.

(path string, stdin io.ReadCloser)

Source from the content-addressed store, hash-verified

20// for resolving local attachment references. Standard input has no base
21// directory.
22func ReadMarkdownBodyFile(path string, stdin io.ReadCloser) (content, dir string, err error) {
23 b, err := ReadFile(path, stdin)
24 if err != nil {
25 return "", "", err
26 }
27 if path != "-" {
28 dir = filepath.Dir(path)
29 }
30 return string(b), dir, nil
31}

Callers 8

NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
ReadContentFunction · 0.92
NewCmdEditFunction · 0.92
NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
TestReadMarkdownBodyFileFunction · 0.85

Calls 1

ReadFileFunction · 0.85

Tested by 1

TestReadMarkdownBodyFileFunction · 0.68