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.

26 line
758 B

  1. /* eslint-disable @typescript-eslint/no-var-requires */
  2. const fs = require('fs');
  3. // Patch README
  4. const insert = fs.readFileSync('./README.pre.md', { encoding: 'utf8' });
  5. const data = fs.readFileSync('./README.md', { encoding: 'utf8' });
  6. fs.writeFileSync('./README.md', `${insert}\n${data}`);
  7. // Patch package.json
  8. const date = new Date(new Date().toLocaleString('en-US', { timeZone: 'America/New_York' }));
  9. let packageJSON = require('../package.json');
  10. packageJSON = JSON.stringify(
  11. {
  12. ...packageJSON,
  13. version: `${String(date.getFullYear())}.${date.getMonth() + 1}.${date.getDate()}${String(
  14. date.getHours(),
  15. ).padStart(2, '0')}`,
  16. preview: true,
  17. },
  18. undefined,
  19. '\t',
  20. );
  21. packageJSON += '\n';
  22. fs.writeFileSync('./package.json', packageJSON);