aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-04-04 02:14:36 +0800
committerGitHub <noreply@github.com>2018-04-04 02:14:36 +0800
commit4a9752d7cda05f616d2709e34f4687da813d3090 (patch)
treeb00a8e74aee2fe39f5999e081616144a9a8c265f /packages/monorepo-scripts/src/publish.ts
parent7db9a016395eb699e7f9c531dbec2616cd2b819b (diff)
parent185f70f2ddfb5521beecf62bb400aee54f90acf3 (diff)
downloaddexon-0x-contracts-4a9752d7cda05f616d2709e34f4687da813d3090.tar.gz
dexon-0x-contracts-4a9752d7cda05f616d2709e34f4687da813d3090.tar.zst
dexon-0x-contracts-4a9752d7cda05f616d2709e34f4687da813d3090.zip
Merge pull request #495 from 0xProject/fix/publishProcess
Improve Publish Flow
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index d749ec630..adc1de64a 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -48,7 +48,7 @@ const semverNameToIndex: { [semver: string]: number } = {
}
const currentVersion = lernaPackage.package.version;
- const shouldAddNewEntry = shouldAddNewChangelogEntry(changelogs);
+ const shouldAddNewEntry = shouldAddNewChangelogEntry(currentVersion, changelogs);
if (shouldAddNewEntry) {
// Create a new entry for a patch version with generic changelog entry.
const nextPatchVersion = utils.getNextPatchVersion(currentVersion);
@@ -174,12 +174,13 @@ function getChangelogJSONOrCreateIfMissing(packageName: string, changelogPath: s
}
}
-function shouldAddNewChangelogEntry(changelogs: Changelog[]): boolean {
+function shouldAddNewChangelogEntry(currentVersion: string, changelogs: Changelog[]): boolean {
if (_.isEmpty(changelogs)) {
return true;
}
const lastEntry = changelogs[0];
- return !!lastEntry.isPublished;
+ const lastEntryCurrentVersion = lastEntry.version === currentVersion;
+ return lastEntryCurrentVersion;
}
function generateChangelogMd(changelogs: Changelog[]): string {