diff options
author | Fabio Berger <me@fabioberger.com> | 2018-04-02 14:53:31 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-04-02 14:53:31 +0800 |
commit | 3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a (patch) | |
tree | 49dc4031787929b015b25e0f70aa94ee4fe24050 /packages/monorepo-scripts/src/utils.ts | |
parent | 2a6a71ea6cd89d39142f51530d06e80ffc44e722 (diff) | |
download | dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar.gz dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar.bz2 dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar.lz dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar.xz dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.tar.zst dexon-sol-tools-3f230a8fdbca3728a4d6b1677d776b8e0dbbae6a.zip |
Move prettify command to utils and also call it on CHANGELOG.md
Diffstat (limited to 'packages/monorepo-scripts/src/utils.ts')
-rw-r--r-- | packages/monorepo-scripts/src/utils.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/monorepo-scripts/src/utils.ts b/packages/monorepo-scripts/src/utils.ts index 73f6260d3..9aa37e272 100644 --- a/packages/monorepo-scripts/src/utils.ts +++ b/packages/monorepo-scripts/src/utils.ts @@ -1,4 +1,5 @@ import * as _ from 'lodash'; +import { exec as execAsync, spawn } from 'promisify-child-process'; export const utils = { log(...args: any[]): void { @@ -11,4 +12,9 @@ export const utils = { const newPatchVersion = `${versionSegments[0]}.${versionSegments[1]}.${newPatch}`; return newPatchVersion; }, + async prettifyAsync(filePath: string, cwd: string) { + await execAsync(`prettier --write ${filePath} --config .prettierrc`, { + cwd, + }); + }, }; |