(file)
| 387 | |
| 388 | /* reads a file, runs replacement and writes it back */ |
| 389 | function processFile(file) { |
| 390 | fs.readFile(file, {encoding: 'utf8'}, function (err, data) { |
| 391 | if (err) { |
| 392 | throw err; |
| 393 | } |
| 394 | |
| 395 | /* run replacement twice, might need more runs */ |
| 396 | fs.writeFile(file, data.replace(master, replace).replace(master, replace), function (err) { |
| 397 | if (err) { |
| 398 | throw err; |
| 399 | } |
| 400 | }); |
| 401 | }); |
| 402 | } |
| 403 | |
| 404 | /* process file names from command line and process the identified files */ |
| 405 | for (i = 2, length = process.argv.length; i < length; i++) { |
nothing calls this directly
no outgoing calls
no test coverage detected