diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-29 21:18:42 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-29 21:18:42 +0800 |
commit | bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c (patch) | |
tree | da84bb9864966a28a7ef8eebc4d345b0ef38de43 /packages/monorepo-scripts/src/utils.ts | |
parent | 397cd77ef91e88da4dd71908770659343f0b7c35 (diff) | |
download | dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar.gz dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar.bz2 dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar.lz dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar.xz dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.tar.zst dexon-sol-tools-bd7b5c51b2be9140c9d5ba3ca208ba4231eca83c.zip |
Add 0.x.x edgecase
Diffstat (limited to 'packages/monorepo-scripts/src/utils.ts')
-rw-r--r-- | packages/monorepo-scripts/src/utils.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/utils.ts b/packages/monorepo-scripts/src/utils.ts index 5423cabd9..73f6260d3 100644 --- a/packages/monorepo-scripts/src/utils.ts +++ b/packages/monorepo-scripts/src/utils.ts @@ -1,5 +1,14 @@ +import * as _ from 'lodash'; + export const utils = { log(...args: any[]): void { console.log(...args); // tslint:disable-line:no-console }, + getNextPatchVersion(currentVersion: string): string { + const versionSegments = currentVersion.split('.'); + const patch = _.parseInt(_.last(versionSegments) as string); + const newPatch = patch + 1; + const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`; + return newPatchVersion; + }, }; |