(projectRoot: string)
| 64 | } |
| 65 | |
| 66 | function 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 | |
| 73 | function resolveRealPath(filePath: string): string { |
| 74 | try { |
no test coverage detected