build: fix changelog generation
This commit is contained in:
parent
00df9b574c
commit
9eae9d2a6e
4 changed files with 18 additions and 12 deletions
|
|
@ -1,8 +1,12 @@
|
|||
import { getChangelog } from './changelog/util.js';
|
||||
import fs from 'node:fs';
|
||||
|
||||
const file = process.argv[3]
|
||||
? fs.createWriteStream(process.argv[3])
|
||||
: process.stdout;
|
||||
const stream = getChangelog(!!process.argv[2]).setEncoding('utf8');
|
||||
|
||||
getChangelog(process.argv[2], !!process.argv[2]).pipe(file);
|
||||
const changes = (await stream.toArray()).join('');
|
||||
|
||||
if (!changes.length) {
|
||||
console.error('No changelog found');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
process.stdout.write(changes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue