aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-03-30 18:43:03 +0800
committerFabio Berger <me@fabioberger.com>2018-03-30 18:43:03 +0800
commitef4919217079dae761db9394527172ed06c1d030 (patch)
treedaa0b2ef111e40f340b1942edd40a4bf154b9a6b /packages
parentc9df3887316bdc0f7b19c87df21d566047445728 (diff)
downloaddexon-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')
-rw-r--r--packages/monorepo-scripts/src/custom_prepublish.ts7
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;