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

Function listParentDirectories

src/utils/xcode-state-reader.ts:43–72  ·  view source on GitHub ↗
(startPath: string, boundaryPath: string)

Source from the content-addressed store, hash-verified

41}
42
43function listParentDirectories(startPath: string, boundaryPath: string): string[] {
44 const parents: string[] = [];
45 const start = resolve(startPath);
46 const boundary = resolve(boundaryPath);
47
48 if (!isPathWithinBoundary(start, boundary)) {
49 return parents;
50 }
51
52 let current = start;
53 while (true) {
54 const parent = dirname(current);
55 if (parent === current) {
56 break;
57 }
58
59 if (!isPathWithinBoundary(parent, boundary)) {
60 break;
61 }
62
63 parents.push(parent);
64 if (parent === boundary) {
65 break;
66 }
67
68 current = parent;
69 }
70
71 return parents;
72}
73
74function collectFindPaths(output: string): string[] {
75 return output

Callers 1

findXcodeStateFileFunction · 0.85

Calls 3

resolveFunction · 0.85
isPathWithinBoundaryFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected