| 32 | const RUBI_REPO = 'https://github.com/RuleBasedIntegration/Rubi'; |
| 33 | |
| 34 | function listRuleFiles(root: string, subdir = ''): string[] { |
| 35 | const result: string[] = []; |
| 36 | for (const entry of fs.readdirSync(path.join(root, subdir), { |
| 37 | withFileTypes: true, |
| 38 | })) { |
| 39 | const rel = path.join(subdir, entry.name); |
| 40 | if (entry.isDirectory()) result.push(...listRuleFiles(root, rel)); |
| 41 | else if (entry.name.endsWith('.m')) result.push(rel); |
| 42 | } |
| 43 | return result.sort(); |
| 44 | } |
| 45 | |
| 46 | function sha256Dir(root: string, files: string[]): string { |
| 47 | const h = crypto.createHash('sha256'); |