diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-02 16:33:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 16:33:13 +0800 |
commit | 40ab2de393a1c9e87c0df4c72dc7c76fe60eb720 (patch) | |
tree | 38c6f9b4b391a1a9b4dc94d8fe7ffecf8091eed8 /packages/monorepo-scripts/src/utils.ts | |
parent | a220b56736bcacfcce045329c99091af5932e723 (diff) | |
parent | 723276ae3fe460ebb89b9b0948c3423e021e2cf9 (diff) | |
download | dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar.gz dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar.bz2 dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar.lz dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar.xz dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.tar.zst dexon-0x-contracts-40ab2de393a1c9e87c0df4c72dc7c76fe60eb720.zip |
Merge pull request #489 from 0xProject/refactor/publishProcess
Automate NPM Publish Process
Diffstat (limited to 'packages/monorepo-scripts/src/utils.ts')
-rw-r--r-- | packages/monorepo-scripts/src/utils.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/utils.ts b/packages/monorepo-scripts/src/utils.ts index 5423cabd9..9aa37e272 100644 --- a/packages/monorepo-scripts/src/utils.ts +++ b/packages/monorepo-scripts/src/utils.ts @@ -1,5 +1,20 @@ +import * as _ from 'lodash'; +import { exec as execAsync, spawn } from 'promisify-child-process'; + 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; + }, + async prettifyAsync(filePath: string, cwd: string) { + await execAsync(`prettier --write ${filePath} --config .prettierrc`, { + cwd, + }); + }, }; |