(startDir: string)
| 21 | * Returns the absolute path to the config file, or null if not found. |
| 22 | */ |
| 23 | export function findConfigFile(startDir: string): string | null { |
| 24 | let current = startDir; |
| 25 | while (true) { |
| 26 | const candidate = path.join(current, CONFIG_FILENAME); |
| 27 | if (fs.existsSync(candidate)) { |
| 28 | return candidate; |
| 29 | } |
| 30 | const parent = path.dirname(current); |
| 31 | if (parent === current) break; // reached filesystem root |
| 32 | current = parent; |
| 33 | } |
| 34 | return null; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Parse a `.taskmd.yaml` config file. Returns null on any error. |
no outgoing calls
no test coverage detected