Files
dooring/script/changelog.js

33 lines
636 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',
'dooringx-doc',
'src',
'changelog',
'1.1.md'
);
const isExist = fs.existsSync(doclog);
if (isExist) {
fs.removeSync(doclog);
}
2021-07-28 11:46:25 +08:00
const prepend = `---
2021-07-20 19:28:51 +08:00
title: CHANGELOG
order: 1
---
`;
const data = prepend + fs.readFileSync(changelog).toString();
fs.writeFileSync(doclog, data);