(root: string)
| 7 | const MAX_PRUNED_PACKAGE_COUNT = 25 |
| 8 | |
| 9 | async function listPackages(root: string): Promise<string[]> { |
| 10 | try { |
| 11 | const entries = await readdir(root) |
| 12 | const result: string[] = [] |
| 13 | for (const entry of entries) { |
| 14 | const full = path.join(root, entry) |
| 15 | const s = await stat(full) |
| 16 | if (s.isDirectory()) { |
| 17 | result.push(entry) |
| 18 | } |
| 19 | } |
| 20 | return result |
| 21 | } catch { |
| 22 | return [] |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | async function main() { |
| 27 | const scratch = await mkdtemp(path.join(tmpdir(), 'sim-realtime-prune-')) |