(envCfg: Record<string, string>)
| 5 | import { writeFileSync } from 'fs' |
| 6 | |
| 7 | function generateFromTo(envCfg: Record<string, string>): { |
| 8 | from: string[] | RegExp[] |
| 9 | to: string[] |
| 10 | } { |
| 11 | const from = Object.keys(envCfg) |
| 12 | .map((key) => `${Cfg.PLACEHOLDER_2}${key}`) |
| 13 | .map((key) => new RegExp(`\\b${key}\\b`, 'g')) |
| 14 | const to = Object.values(envCfg) |
| 15 | return { |
| 16 | from: from, |
| 17 | to: to |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export function copyFolder(dir: string, copyDir: string): string { |
| 22 | shell.cp('-R', dir, copyDir) |