(dir: string, kind: SessionFileKind)
| 69 | * peers. Fall back to a legacy flat file only when no current layout exists. |
| 70 | */ |
| 71 | export function sessionFilePath(dir: string, kind: SessionFileKind): string { |
| 72 | const candidates = sessionFileCandidates(dir, kind); |
| 73 | if (currentLayoutExists(dir)) return candidates.current; |
| 74 | return fs.existsSync(candidates.legacy) ? candidates.legacy : candidates.current; |
| 75 | } |
| 76 | |
| 77 | /** Effective path for a hook script, with the same layout choice as session files. */ |
| 78 | export function hookScriptPath(workDir: string, stage: HookStage): string { |
no test coverage detected