(projectPath: string, workspaceName: string)
| 282 | * Hash suffix prevents collisions (e.g., feature/foo vs feature-foo) |
| 283 | */ |
| 284 | export function getContainerName(projectPath: string, workspaceName: string): string { |
| 285 | const projectName = getProjectName(projectPath); |
| 286 | const hash = createHash("sha256") |
| 287 | .update(`${projectPath}:${workspaceName}`) |
| 288 | .digest("hex") |
| 289 | .slice(0, 6); |
| 290 | // Reserve 7 chars for "-{hash}", leaving 56 for base |
| 291 | const base = sanitizeContainerName(`mux-${projectName}-${workspaceName}`).slice(0, 56); |
| 292 | return `${base}-${hash}`; |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Docker runtime implementation that executes commands inside Docker containers. |
no test coverage detected