(filename, searchValue, replaceValue)
| 21 | }; |
| 22 | |
| 23 | function replace(filename, searchValue, replaceValue) { |
| 24 | let text = fs.readFileSync(filename, "utf8"); |
| 25 | if (text.match(searchValue)) { |
| 26 | text = text.replace(searchValue, replaceValue); |
| 27 | fs.writeFileSync(filename, text, "utf8"); |
| 28 | return true; |
| 29 | } else { |
| 30 | return `Failed to find ${searchValue} in ${filename}`; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | const questions = [ |
| 35 | { |