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
|
|
|
|
|
2020-10-13 01:40:21 +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,
|
|
|
|
|
// });
|
2020-10-13 01:40:21 +08:00
|
|
|
|
successConsole('CHANGE_LOG.md generated successfully!');
|
2020-09-28 20:19:10 +08:00
|
|
|
|
} catch (error) {
|
2020-10-13 01:40:21 +08:00
|
|
|
|
errorConsole('CHANGE_LOG.md generated error\n' + error);
|
|
|
|
|
|
2020-09-28 20:19:10 +08:00
|
|
|
|
process.exit(1);
|
|
|
|
|
}
|
|
|
|
|
};
|