(filePath, searchString, replacement)
| 41 | } |
| 42 | |
| 43 | function replaceInFile(filePath, searchString, replacement) { |
| 44 | const data = fs.readFileSync(filePath, 'utf-8'); |
| 45 | if (data.includes(searchString)) { |
| 46 | const updatedData = data.replace(new RegExp(searchString, 'g'), replacement); |
| 47 | fs.writeFileSync(filePath, updatedData, 'utf-8'); |
| 48 | console.log(`In file ${filePath}, "${searchString}" was replaced with "${replacement}"`); |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | function replaceFileNameInFiles() { |
| 53 | const dir = path.resolve(__dirname, "../lib-mt/"); |
no test coverage detected