MCPcopy Index your code
hub / github.com/codeaashu/claude-code / formatBashOutput

Function formatBashOutput

src/utils/promptShellExecution.ts:145–165  ·  view source on GitHub ↗
(
  stdout: string,
  stderr: string,
  inline = false,
)

Source from the content-addressed store, hash-verified

143}
144
145function formatBashOutput(
146 stdout: string,
147 stderr: string,
148 inline = false,
149): string {
150 const parts: string[] = []
151
152 if (stdout.trim()) {
153 parts.push(stdout.trim())
154 }
155
156 if (stderr.trim()) {
157 if (inline) {
158 parts.push(`[stderr: ${stderr.trim()}]`)
159 } else {
160 parts.push(`[stderr]\n${stderr.trim()}`)
161 }
162 }
163
164 return parts.join(inline ? ' ' : '\n')
165}
166
167function formatBashError(e: unknown, pattern: string, inline = false): never {
168 if (e instanceof ShellError) {

Callers 2

formatBashErrorFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected