(scriptName)
| 53 | |
| 54 | // ---- Utility helpers -------------------------------------------------------- |
| 55 | |
| 56 | function ensureDir(dir) { |
| 57 | if (!DRY_RUN && !fs.existsSync(dir)) { |
| 58 | fs.mkdirSync(dir, { recursive: true }); |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | function writeFile(filePath, content) { |
| 63 | if (DRY_RUN) { |
| 64 | console.log(` [dry-run] Would write: ${filePath}`); |
| 65 | return; |
| 66 | } |
| 67 | ensureDir(path.dirname(filePath)); |
| 68 | fs.writeFileSync(filePath, content, 'utf8'); |
| 69 | } |
| 70 |
no outgoing calls
no test coverage detected