MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / formatCliTextLine

Function formatCliTextLine

src/utils/terminal-output.ts:22–50  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

20}
21
22export function formatCliTextLine(line: string): string {
23 if (!shouldUseCliColor()) {
24 return line;
25 }
26
27 if (/^\s*(?:.*:\s+)?(?:fatal )?error:\s/iu.test(line)) {
28 return colorRed(line);
29 }
30
31 if (/^\s*⚠ /u.test(line)) {
32 return line.replace(
33 /^(\s*)(⚠ )/u,
34 (_m, indent: string, prefix: string) => `${indent}${colorYellow(prefix)}`,
35 );
36 }
37
38 if (/^\s*✗ /u.test(line)) {
39 return line.replace(
40 /^(\s*)(✗ )/u,
41 (_m, indent: string, prefix: string) => `${indent}${colorRed(prefix)}`,
42 );
43 }
44
45 if (/^❌ /u.test(line)) {
46 return line.replace(/^(❌ )/u, (_m, prefix: string) => colorRed(prefix));
47 }
48
49 return line;
50}

Callers 1

formatCliTextBlockFunction · 0.90

Calls 3

shouldUseCliColorFunction · 0.85
colorRedFunction · 0.85
colorYellowFunction · 0.85

Tested by

no test coverage detected