* Check if a Python file contains a top-level app/handler. * Returns the matched variable name (e.g. "app"), or null if not found.
( workPath: string, relPath: string )
| 151 | * Returns the matched variable name (e.g. "app"), or null if not found. |
| 152 | */ |
| 153 | async function checkEntrypoint( |
| 154 | workPath: string, |
| 155 | relPath: string |
| 156 | ): Promise<string | null> { |
| 157 | const absPath = join(workPath, relPath); |
| 158 | if (!(await fileExists(absPath))) return null; |
| 159 | const content = await fs.promises.readFile(absPath, 'utf-8'); |
| 160 | return findAppOrHandler(content); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Recursively walk workPath collecting .py files, skipping hidden dirs, |
no test coverage detected