MCPcopy Create free account
hub / github.com/Noumena-Network/code / findSaplingWorkspaceRoot

Function findSaplingWorkspaceRoot

src/utils/citcWorkspaceSource.ts:124–142  ·  view source on GitHub ↗
(
  startPath: string,
)

Source from the content-addressed store, hash-verified

122}
123
124export async function findSaplingWorkspaceRoot(
125 startPath: string,
126): Promise<string | null> {
127 let current = resolve(startPath)
128
129 while (true) {
130 for (const candidate of COMMIT_CLOUD_RC_CANDIDATES) {
131 if ((await readTextIfExists(join(current, candidate))) !== null) {
132 return current
133 }
134 }
135
136 const parent = dirname(current)
137 if (parent === current) {
138 return null
139 }
140 current = parent
141 }
142}
143
144async function getCloudStatusViaSapling(repoRoot: string): Promise<string | null> {
145 const candidates = [process.env.NCODE_HG_BINARY, 'sl'].filter(

Callers 1

Calls 2

readTextIfExistsFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected