vue-vben-admin/build/script/changelog.ts

34 lines
834 B
TypeScript
Raw Normal View History

2020-09-28 20:19:10 +08:00
// #!/usr/bin/env node
2020-10-14 22:57:52 +08:00
// import { sh } from 'tasksfile';
import { errorConsole, successConsole, run } from '../utils';
2020-09-28 20:19:10 +08:00
export const runChangeLog = async () => {
2020-09-28 20:19:10 +08:00
try {
2020-10-14 22:57:52 +08:00
// let cmd = `conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0 `;
await run('conventional-changelog', [
'-p',
'custom-config',
'-i',
'CHANGELOG.md',
'-s',
'-r',
'-0',
]);
// await sh(cmd, {
// async: true,
// nopipe: true,
// });
await run('prettier', ['--write', '**/CHANGELOG.md']);
// await sh('prettier --write **/CHANGELOG.md ', {
// async: true,
// nopipe: true,
// });
successConsole('CHANGE_LOG.md generated successfully');
2020-09-28 20:19:10 +08:00
} catch (error) {
errorConsole('CHANGE_LOG.md generated error\n' + error);
2020-09-28 20:19:10 +08:00
process.exit(1);
}
};