(src: string, dest: string)
| 180 | }; |
| 181 | |
| 182 | export const copyDir = (src: string, dest: string) => { |
| 183 | const srcStat = fs.lstatSync(src); |
| 184 | if (srcStat.isDirectory()) { |
| 185 | if (!fs.existsSync(dest)) { |
| 186 | fs.mkdirSync(dest); |
| 187 | } |
| 188 | fs.readdirSync(src).map(filePath => |
| 189 | copyDir(path.join(src, filePath), path.join(dest, filePath)), |
| 190 | ); |
| 191 | } else { |
| 192 | fs.writeFileSync(dest, fs.readFileSync(src)); |
| 193 | } |
| 194 | }; |
| 195 | |
| 196 | export const replaceSeed = (str: string) => |
| 197 | str.replaceAll(/Seed: {8}(-?\d+)/g, 'Seed: <<REPLACED>>'); |