aboutsummaryrefslogtreecommitdiffstats
path: root/packages/monorepo-scripts/src/publish.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-06-19 01:22:31 +0800
committerFabio Berger <me@fabioberger.com>2018-06-19 05:08:44 +0800
commitdcd53c3c5bc251af242166cf758146649eb4185b (patch)
treef9c0401be6a3de8a5907e4a4425eccc8e0de844f /packages/monorepo-scripts/src/publish.ts
parent3e64b3da398a90e6ddfc287ebf28ec780b64b56f (diff)
downloaddexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar.gz
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar.bz2
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar.lz
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar.xz
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.tar.zst
dexon-sol-tools-dcd53c3c5bc251af242166cf758146649eb4185b.zip
Use semver package instead of getNextPatchVersion
Diffstat (limited to 'packages/monorepo-scripts/src/publish.ts')
-rw-r--r--packages/monorepo-scripts/src/publish.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/monorepo-scripts/src/publish.ts b/packages/monorepo-scripts/src/publish.ts
index cdd250ec3..5f4c67e04 100644
--- a/packages/monorepo-scripts/src/publish.ts
+++ b/packages/monorepo-scripts/src/publish.ts
@@ -213,12 +213,16 @@ async function lernaPublishAsync(packageToVersionChange: { [name: string]: strin
}
function updateVersionNumberIfNeeded(currentVersion: string, proposedNextVersion: string): string {
+ const updatedVersionIfValid = semver.inc(currentVersion, 'patch');
+ if (_.isNull(updatedVersionIfValid)) {
+ throw new Error(`Encountered invalid semver: ${currentVersion}`);
+ }
if (proposedNextVersion === currentVersion) {
- return utils.getNextPatchVersion(currentVersion);
+ return updatedVersionIfValid;
}
const sortedVersions = semverSort.desc([proposedNextVersion, currentVersion]);
if (sortedVersions[0] !== proposedNextVersion) {
- return utils.getNextPatchVersion(currentVersion);
+ return updatedVersionIfValid;
}
return proposedNextVersion;
}