您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

26 行
758 B

/* eslint-disable @typescript-eslint/no-var-requires */
const fs = require('fs');
// Patch README
const insert = fs.readFileSync('./README.pre.md', { encoding: 'utf8' });
const data = fs.readFileSync('./README.md', { encoding: 'utf8' });
fs.writeFileSync('./README.md', `${insert}\n${data}`);
// Patch package.json
const date = new Date(new Date().toLocaleString('en-US', { timeZone: 'America/New_York' }));
let packageJSON = require('../package.json');
packageJSON = JSON.stringify(
{
...packageJSON,
version: `${String(date.getFullYear())}.${date.getMonth() + 1}.${date.getDate()}${String(
date.getHours(),
).padStart(2, '0')}`,
preview: true,
},
undefined,
'\t',
);
packageJSON += '\n';
fs.writeFileSync('./package.json', packageJSON);