()
| 15 | import { getMuxSrcDir } from "@/common/constants/paths"; |
| 16 | |
| 17 | function findWorkspaces(): Array<{ id: string; path: string }> { |
| 18 | const workspaces: Array<{ id: string; path: string }> = []; |
| 19 | const muxSrcDir = getMuxSrcDir(); |
| 20 | |
| 21 | try { |
| 22 | const projects = readdirSync(muxSrcDir); |
| 23 | for (const project of projects) { |
| 24 | const projectPath = join(muxSrcDir, project); |
| 25 | if (!statSync(projectPath).isDirectory()) continue; |
| 26 | |
| 27 | const branches = readdirSync(projectPath); |
| 28 | for (const branch of branches) { |
| 29 | const workspacePath = join(projectPath, branch); |
| 30 | if (statSync(workspacePath).isDirectory()) { |
| 31 | workspaces.push({ |
| 32 | // NOTE: Using directory name as display ID for debug purposes only. |
| 33 | // This is NOT how workspace IDs are determined in production code. |
| 34 | // Production workspace IDs come from metadata.json in the session dir. |
| 35 | id: branch, |
| 36 | path: workspacePath, |
| 37 | }); |
| 38 | } |
| 39 | } |
| 40 | } |
| 41 | } catch (err) { |
| 42 | console.error("Failed to find workspaces:", err); |
| 43 | } |
| 44 | |
| 45 | return workspaces; |
| 46 | } |
| 47 | |
| 48 | function testGitStatus(workspaceId: string, workspacePath: string) { |
| 49 | console.log("\n" + "=".repeat(80)); |
no test coverage detected