Files
dooring/script/changelog.js

36 lines
686 B
JavaScript
Raw Normal View History

2021-07-20 19:28:51 +08:00
/*
* @Author: yehuozhili
* @Date: 2021-07-20 17:38:03
* @LastEditors: yehuozhili
2021-07-28 11:46:25 +08:00
* @LastEditTime: 2021-07-28 10:30:54
2021-07-20 19:28:51 +08:00
* @FilePath: \dooringx\script\changelog.js
*/
const fs = require('fs-extra');
const path = require('path');
const changelog = path.resolve(process.cwd(), 'CHANGELOG.md');
const doclog = path.resolve(
process.cwd(),
'packages',
2021-11-24 12:50:19 +08:00
'dooringx-dumi-doc',
'docs',
'ChangeLog',
'index.md'
2021-07-20 19:28:51 +08:00
);
const isExist = fs.existsSync(doclog);
if (isExist) {
fs.removeSync(doclog);
}
2021-07-28 11:46:25 +08:00
const prepend = `---
2021-11-24 12:50:19 +08:00
title: 变更日志
toc: menu
nav:
title: 变更日志
order: 6
2021-07-20 19:28:51 +08:00
---
`;
const data = prepend + fs.readFileSync(changelog).toString();
fs.writeFileSync(doclog, data);