UNPKG

norminette-mcp

Version:

MCP server for 42 School norminette coding standard checker

17 lines (16 loc) 477 B
import * as fs from "fs"; import * as path from "path"; export function getAllCFiles(dir) { const files = []; const items = fs.readdirSync(dir); for (const item of items) { const fullPath = path.join(dir, item); if (fs.statSync(fullPath).isDirectory()) { files.push(...getAllCFiles(fullPath)); } else if (item.endsWith('.c') || item.endsWith('.h')) { files.push(fullPath); } } return files; }