MCPcopy Create free account
hub / github.com/expo/expo / formatXcodeBuildOutput

Function formatXcodeBuildOutput

tools/src/Formatter.ts:83–100  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

81 * Makes Xcode logs pretty as xcpretty :)
82 */
83export function formatXcodeBuildOutput(output: string): string {
84 return output
85 .replace(/^(\/.*)(:\d+:\d+): (error|warning|note)(:.*)$/gm, (_, p1, p2, p3, p4) => {
86 if (p3 === 'note') {
87 return gray.bold(p3) + white.bold(p4);
88 }
89 const relativePath = path.relative(process.cwd(), p1);
90 const logColor = p3 === 'error' ? red.bold : yellow.bold;
91
92 return cyan.bold(relativePath + p2) + ' ' + logColor(p3 + p4);
93 })
94 .replace(/^(In file included from )(\/[^\n]+)(:\d+:[^\n]*)$/gm, (_, p1, p2, p3) => {
95 const relativePath = path.relative(process.cwd(), p2);
96 return gray.italic(p1 + relativePath + p3);
97 })
98 .replace(/\s\^\n(\s[^\n]+)?/g, green.bold('$&\n'))
99 .replace(/\*\* BUILD FAILED \*\*/, red.bold('$&'));
100}

Callers 1

xcodebuildAsyncMethod · 0.90

Calls 2

replaceMethod · 0.45
relativeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…