(filePath, content)
| 35 | } |
| 36 | |
| 37 | async function writeIfChanged(filePath, content) { |
| 38 | let prev = null; |
| 39 | try { |
| 40 | prev = await fs.readFile(filePath, "utf8"); |
| 41 | } catch { |
| 42 | // ignore |
| 43 | } |
| 44 | if (prev === content) return false; |
| 45 | await fs.writeFile(filePath, content, "utf8"); |
| 46 | return true; |
| 47 | } |
| 48 | |
| 49 | async function main() { |
| 50 | // Ensure icons dir exists |