fix(cli): changelog should be async task

This commit is contained in:
陈嘉涵 2019-12-29 09:13:06 +08:00
parent f9bef02730
commit 23b1af95e8
2 changed files with 23 additions and 20 deletions

View File

@ -46,25 +46,28 @@ function transform(item: any) {
return item; return item;
} }
export function changelog() { export async function changelog() {
logger.start('Generating changelog...'); logger.start('Generating changelog...');
conventionalChangelog( return new Promise(resolve => {
{ conventionalChangelog(
preset: 'angular' {
}, preset: 'angular'
null, },
null, null,
null, null,
{ null,
mainTemplate, {
headerPartial, mainTemplate,
commitPartial, headerPartial,
transform commitPartial,
} transform
) }
.pipe(createWriteStream(DIST_FILE)) )
.on('close', () => { .pipe(createWriteStream(DIST_FILE))
logger.success(`Generated changelog at ${DIST_FILE}`); .on('close', () => {
}); logger.success(`Generated changelog at ${DIST_FILE}`);
resolve();
});
});
} }

View File

@ -9,7 +9,7 @@ class VantCliReleasePlugin extends releaseIt.Plugin {
console.log(''); console.log('');
await build(); await build();
changelog(); await changelog();
} }
} }