Add check that timestamp has been set before generating MD version

This commit is contained in:
Fabio Berger
2018-03-30 12:43:03 +02:00
parent c9df388731
commit ef49192170

View File

@@ -139,7 +139,12 @@ CHANGELOG
`;
_.each(changelogs, changelog => {
const date = moment(changelog.timestamp, 'X').format('MMMM D, YYYY');
if (_.isUndefined(changelog.timestamp)) {
throw new Error(
'All CHANGELOG.json entries must be updated to include a timestamp before generating their MD version',
);
}
const date = moment(`${changelog.timestamp}`, 'X').format('MMMM D, YYYY');
const title = `\n## v${changelog.version} - _${date}_\n\n`;
changelogMd += title;