diff options
author | Fabio Berger <me@fabioberger.com> | 2018-08-22 01:49:56 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-08-22 01:49:56 +0800 |
commit | 8bb7b5b543c4d914067b6bbb269be9cc2ac7f647 (patch) | |
tree | 8148028d1a7d621b27e54b948cdb8fa2d3dca708 /packages/monorepo-scripts/src/utils | |
parent | 809d301d582a01ff70958f380a7f8c4afe898366 (diff) | |
download | dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar.gz dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar.bz2 dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar.lz dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar.xz dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.tar.zst dexon-sol-tools-8bb7b5b543c4d914067b6bbb269be9cc2ac7f647.zip |
Add shouldUpload flag to docGenAndUpload command
Diffstat (limited to 'packages/monorepo-scripts/src/utils')
-rw-r--r-- | packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts index cc4d70d63..7e8bd07da 100644 --- a/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts +++ b/packages/monorepo-scripts/src/utils/doc_generate_and_upload_utils.ts @@ -12,6 +12,7 @@ import { utils } from './utils'; export class DocGenerateAndUploadUtils { private _isStaging: boolean; + private _shouldUploadDocs: boolean; private _packageName: string; private _omitExports: string[]; private _packagePath: string; @@ -155,9 +156,10 @@ export class DocGenerateAndUploadUtils { }; return exportInfo; } - constructor(packageName: string, isStaging: boolean) { + constructor(packageName: string, isStaging: boolean, shouldUploadDocs: boolean) { this._isStaging = isStaging; this._packageName = packageName; + this._shouldUploadDocs = shouldUploadDocs; this._packagePath = `${constants.monorepoRootPath}/packages/${packageName}`; this._monoRepoPkgNameToPath = {}; @@ -268,6 +270,11 @@ export class DocGenerateAndUploadUtils { }; writeFileSync(jsonFilePath, JSON.stringify(docJson, null, 2)); + if (this._shouldUploadDocs) { + await this._uploadDocsAsync(jsonFilePath, cwd); + } + } + private async _uploadDocsAsync(jsonFilePath: string, cwd: string) { const fileName = `v${this._packageJson.version}.json`; utils.log(`GENERATE_UPLOAD_DOCS: Doc generation successful, uploading docs... as ${fileName}`); |