2020-09-28 20:19:10 +08:00
|
|
|
|
// #!/usr/bin/env node
|
|
|
|
|
|
2020-10-15 21:38:50 +08:00
|
|
|
|
import { sh } from 'tasksfile';
|
|
|
|
|
import { errorConsole, successConsole } 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-15 21:38:50 +08:00
|
|
|
|
let cmd = `conventional-changelog -p custom-config -i CHANGELOG.md -s -r 0 `;
|
|
|
|
|
|
|
|
|
|
await sh(cmd, {
|
|
|
|
|
async: true,
|
|
|
|
|
nopipe: true,
|
|
|
|
|
});
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
};
|
2020-10-26 21:45:43 +08:00
|
|
|
|
|
|
|
|
|
runChangeLog();
|