MCPcopy
hub / github.com/callstack/agent-device / buildSourceCheckoutStateDirName

Function buildSourceCheckoutStateDirName

src/daemon/config.ts:66–71  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

64}
65
66function buildSourceCheckoutStateDirName(projectRoot: string): string {
67 const resolvedRoot = resolveRealPath(projectRoot);
68 const slug = path.basename(resolvedRoot).replaceAll(/[^a-zA-Z0-9._-]+/g, '-');
69 const hash = crypto.createHash('sha1').update(resolvedRoot).digest('hex').slice(0, 12);
70 return `${slug || 'agent-device'}-${hash}`;
71}
72
73function resolveRealPath(filePath: string): string {
74 try {

Callers 1

Calls 2

resolveRealPathFunction · 0.85
updateMethod · 0.80

Tested by

no test coverage detected