Files
dooring/script/changelog.js
hufeixiong b55f43fd0b add doc
2021-07-20 19:28:51 +08:00

35 lines
638 B
JavaScript

/*
* @Author: yehuozhili
* @Date: 2021-07-20 17:38:03
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-20 19:23:46
* @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);
}
const prepend = `
---
title: CHANGELOG
order: 1
---
`;
const data = prepend + fs.readFileSync(changelog).toString();
fs.writeFileSync(doclog, data);