MCPcopy Create free account
hub / github.com/cloudflare/computer / resolveDir

Function resolveDir

packages/computer/src/git/cli.ts:2303–2308  ·  view source on GitHub ↗
(dirArg: string | undefined, cwd: string | undefined)

Source from the content-addressed store, hash-verified

2301// ---------------------------------------------------------------
2302
2303function resolveDir(dirArg: string | undefined, cwd: string | undefined): string {
2304 if (dirArg !== undefined && dirArg !== "") {
2305 return dirArg.startsWith("/") ? dirArg : joinPath(cwd ?? "/", dirArg);
2306 }
2307 return cwd ?? "/";
2308}
2309
2310function joinPath(base: string, segment: string): string {
2311 if (base.endsWith("/")) return `${base}${segment}`;

Callers 15

runCloneFunction · 0.85
runDiffFunction · 0.85
runInitFunction · 0.85
runStatusFunction · 0.85
runAddFunction · 0.85
runRmFunction · 0.85
runCommitFunction · 0.85
runLogFunction · 0.85
runShowFunction · 0.85
runRevParseFunction · 0.85
runSymbolicRefFunction · 0.85
runLsFilesFunction · 0.85

Calls 1

joinPathFunction · 0.70

Tested by

no test coverage detected