You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
438 B

4 years ago
  1. const fs = require('fs');
  2. const { version } = require('../package.json');
  3. const sourcePath = __dirname + '/../src/jquery.rss.js';
  4. const lines = fs.readFileSync(sourcePath).toString().split('\n');
  5. const updatedLines = lines.map((line) => {
  6. if (!line.includes('// Synced version')) {
  7. return line;
  8. }
  9. return ` this.version = '${version}'; // Synced version`
  10. });
  11. fs.writeFileSync(sourcePath, updatedLines.join('\n'));