MCPcopy Create free account
hub / github.com/HKUDS/AgentSpace / findRepositoryRoot

Function findRepositoryRoot

scripts/feishu/run-db-tests.mjs:284–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

282}
283
284function findRepositoryRoot() {
285 let current = dirname(fileURLToPath(import.meta.url));
286 while (true) {
287 if (existsSync(join(current, "Target.md"))) {
288 return current;
289 }
290 const parent = dirname(current);
291 if (parent === current) {
292 return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..");
293 }
294 current = parent;
295 }
296}
297
298function firstValue(...values) {
299 for (const value of values) {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected