(filePath: string, content: string)
| 14 | } |
| 15 | |
| 16 | export function writeFile(filePath: string, content: string) { |
| 17 | // create dirs |
| 18 | const dir = path.dirname(filePath); |
| 19 | if (!fs.existsSync(dir)) { |
| 20 | fs.mkdirSync(dir, { recursive: true }); |
| 21 | } |
| 22 | fs.writeFileSync(filePath, content); |
| 23 | } |
| 24 | |
| 25 | export function checkIfFileExists(filePath: string) { |
| 26 | return fs.existsSync(filePath); |