diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-30 18:43:03 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-30 18:43:03 +0800 |
commit | ef4919217079dae761db9394527172ed06c1d030 (patch) | |
tree | daa0b2ef111e40f340b1942edd40a4bf154b9a6b /packages/monorepo-scripts/src/custom_prepublish.ts | |
parent | c9df3887316bdc0f7b19c87df21d566047445728 (diff) | |
download | dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar.gz dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar.bz2 dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar.lz dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar.xz dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.tar.zst dexon-sol-tools-ef4919217079dae761db9394527172ed06c1d030.zip |
Add check that timestamp has been set before generating MD version
Diffstat (limited to 'packages/monorepo-scripts/src/custom_prepublish.ts')
-rw-r--r-- | packages/monorepo-scripts/src/custom_prepublish.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/monorepo-scripts/src/custom_prepublish.ts b/packages/monorepo-scripts/src/custom_prepublish.ts index 2e6b78a71..f49b67142 100644 --- a/packages/monorepo-scripts/src/custom_prepublish.ts +++ b/packages/monorepo-scripts/src/custom_prepublish.ts @@ -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; |