(customPath?: string | null)
| 21 | * @param customPath Optional custom path. Supports ~ for home directory. |
| 22 | */ |
| 23 | export function getPlanDir(customPath?: string | null): string { |
| 24 | let planDir: string; |
| 25 | |
| 26 | if (customPath?.trim()) { |
| 27 | planDir = resolveUserPath(customPath); |
| 28 | } else { |
| 29 | planDir = join(DATA_DIR, "plans"); |
| 30 | } |
| 31 | |
| 32 | mkdirSync(planDir, { recursive: true }); |
| 33 | return planDir; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Extract the first heading from markdown content. |
no test coverage detected