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.

25 regels
814 B

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