* Copy a directory tree recursively (files only, follows structure).
(src: string, dest: string)
| 94 | * Copy a directory tree recursively (files only, follows structure). |
| 95 | */ |
| 96 | function copyDirSync(src: string, dest: string) { |
| 97 | fs.mkdirSync(dest, { recursive: true }); |
| 98 | for (const entry of fs.readdirSync(src, { withFileTypes: true })) { |
| 99 | const srcPath = path.join(src, entry.name); |
| 100 | const destPath = path.join(dest, entry.name); |
| 101 | if (entry.isDirectory()) { |
| 102 | copyDirSync(srcPath, destPath); |
| 103 | } else { |
| 104 | fs.copyFileSync(srcPath, destPath); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Set up browse shims (binary symlink, find-browse, remote-slug) in a tmpDir. |