(path)
| 12 | } |
| 13 | |
| 14 | async function getDirsWithExercises(path) { |
| 15 | const ignoredDirs = ["archive", "node_modules", "generators"]; |
| 16 | try { |
| 17 | const dirs = await readdir(join(process.cwd(), path), { |
| 18 | withFileTypes: true, |
| 19 | }); |
| 20 | const exerciseDirs = dirs.filter( |
| 21 | (entry) => |
| 22 | entry.isDirectory() && |
| 23 | !entry.name.startsWith(".") && |
| 24 | !ignoredDirs.includes(entry.name), |
| 25 | ); |
| 26 | return exerciseDirs.map((dir) => dir.name); |
| 27 | } catch { |
| 28 | return []; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | async function getLatestExerciseDirectory(path) { |
| 33 | try { |
no outgoing calls
no test coverage detected