(filePath, content)
| 44 | function ensureDir(dir) { |
| 45 | if (!DRY_RUN && !fs.existsSync(dir)) { |
| 46 | fs.mkdirSync(dir, { recursive: true }); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | function writeFile(filePath, content) { |
| 51 | if (DRY_RUN) { |
| 52 | console.log(` [dry-run] Would write: ${filePath}`); |
| 53 | return; |
| 54 | } |
| 55 | ensureDir(path.dirname(filePath)); |
| 56 | fs.writeFileSync(filePath, content, 'utf8'); |
no test coverage detected