(path, replacer)
| 23 | } |
| 24 | |
| 25 | function rewrite(path, replacer) { |
| 26 | try { |
| 27 | const file = readFileSync(path).toString(); |
| 28 | const replaced = replacer(file); |
| 29 | writeFileSync(path, replaced, { flush: true }); |
| 30 | } catch { |
| 31 | // not found |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | let rootVersion; |
| 36 |