MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / findSpec

Function findSpec

tools/spec-loop/hooks/gate.ts:96–112  ·  view source on GitHub ↗
(start: string)

Source from the content-addressed store, hash-verified

94}
95
96function findSpec(start: string): string | null {
97 let current = resolve(start);
98 for (;;) {
99 const spec = join(current, ".specs", "next.md");
100 if (fileExists(spec)) {
101 return spec;
102 }
103 if (dirExists(join(current, ".git"))) {
104 return null;
105 }
106 const parent = dirname(current);
107 if (parent === current) {
108 return null;
109 }
110 current = parent;
111 }
112}
113
114function projectRootFor(spec: string): string {
115 return dirname(dirname(spec));

Callers 1

mainFunction · 0.85

Calls 2

fileExistsFunction · 0.85
dirExistsFunction · 0.85

Tested by

no test coverage detected