| 138 | } |
| 139 | |
| 140 | async function copyDir(src, dest) { |
| 141 | const entries = await fs.readdir(src, { withFileTypes: true }); |
| 142 | await fs.mkdir(dest, { recursive: true }); |
| 143 | await Promise.all( |
| 144 | entries.map((entry) => { |
| 145 | const srcPath = path.join(src, entry.name); |
| 146 | const destPath = path.join(dest, entry.name); |
| 147 | if (entry.isDirectory()) { |
| 148 | return copyDir(srcPath, destPath); |
| 149 | } |
| 150 | return fs.copyFile(srcPath, destPath); |
| 151 | }), |
| 152 | ); |
| 153 | } |
| 154 | |
| 155 | async function compileProto() { |
| 156 | await run('bash', [path.join(ROOT, 'scripts', 'build_proto.sh')]); |