MCPcopy
hub / github.com/cli/cli / BodySurvey

Function BodySurvey

pkg/cmd/pr/shared/survey.go:92–114  ·  view source on GitHub ↗
(p Prompt, state *IssueMetadataState, templateContent string)

Source from the content-addressed store, hash-verified

90}
91
92func BodySurvey(p Prompt, state *IssueMetadataState, templateContent string) error {
93 if templateContent != "" {
94 if state.Body != "" {
95 // prevent excessive newlines between default body and template
96 state.Body = strings.TrimRight(state.Body, "\n")
97 state.Body += "\n\n"
98 }
99 state.Body += templateContent
100 }
101
102 result, err := p.MarkdownEditor("Body", state.Body, true)
103 if err != nil {
104 return err
105 }
106
107 if state.Body != result {
108 state.MarkDirty()
109 }
110
111 state.Body = result
112
113 return nil
114}
115
116func TitleSurvey(p Prompt, io *iostreams.IOStreams, state *IssueMetadataState) error {
117 var err error

Callers 1

createRunFunction · 0.92

Calls 2

MarkDirtyMethod · 0.80
MarkdownEditorMethod · 0.65

Tested by

no test coverage detected