()
| 38 | } |
| 39 | |
| 40 | function main() { |
| 41 | // Get the file path from command line arguments |
| 42 | const filePath = process.argv[2] |
| 43 | |
| 44 | if (!filePath) { |
| 45 | console.error(`Error: Please provide a file path`) |
| 46 | |
| 47 | process.exit(1) |
| 48 | } |
| 49 | |
| 50 | try { |
| 51 | // Read the file |
| 52 | const content = fs.readFileSync(filePath, `utf8`) |
| 53 | |
| 54 | // Replace placeholders |
| 55 | const updatedContent = replaceVersionPlaceholders(content) |
| 56 | |
| 57 | // Write the updated content back to the file |
| 58 | fs.writeFileSync(filePath, updatedContent) |
| 59 | |
| 60 | console.log(`Successfully updated version placeholders in ${filePath}`) |
| 61 | } catch (error) { |
| 62 | console.error(`Error processing file: ${error.message}`) |
| 63 | process.exit(1) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // Execute the main function |
| 68 | main() |
no test coverage detected