* Recursive copy helper for Node.js < 16.7.0 (where fs.cp doesn't exist)
(src, dest)
| 119 | * Recursive copy helper for Node.js < 16.7.0 (where fs.cp doesn't exist) |
| 120 | */ |
| 121 | async function cpRecursive (src, dest) { |
| 122 | const stat = await fss.stat(src) |
| 123 | if (stat.isDirectory()) { |
| 124 | await fss.mkdir(dest, { recursive: true }) |
| 125 | const entries = await fss.readdir(src) |
| 126 | for (const entry of entries) { |
| 127 | await cpRecursive(path.join(src, entry), path.join(dest, entry)) |
| 128 | } |
| 129 | } else { |
| 130 | await fss.copyFile(src, dest) |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * cp from to |