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.

30 rivejä
878 B

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