(rootDir)
| 58 | } |
| 59 | |
| 60 | function listJavaScriptFiles(rootDir) { |
| 61 | const files = []; |
| 62 | const stack = [rootDir]; |
| 63 | |
| 64 | while (stack.length > 0) { |
| 65 | const current = stack.pop(); |
| 66 | let entries; |
| 67 | try { |
| 68 | entries = fs.readdirSync(current, { withFileTypes: true }); |
| 69 | } catch { |
| 70 | continue; |
| 71 | } |
| 72 | |
| 73 | for (const entry of entries) { |
| 74 | const fullPath = path.join(current, entry.name); |
| 75 | if (entry.isDirectory()) { |
| 76 | stack.push(fullPath); |
| 77 | continue; |
| 78 | } |
| 79 | if (entry.isFile() && entry.name.endsWith('.js')) { |
| 80 | files.push(fullPath); |
| 81 | } |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | return files; |
| 86 | } |
| 87 | |
| 88 | export function patchExtensionOpenClawSelfImports(outputDir) { |
| 89 | const distDir = path.join(outputDir, 'dist'); |
no outgoing calls
no test coverage detected