diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-18 03:19:12 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-18 03:19:12 +0800 |
commit | 0402d3de802ba262bb820d582baa157ca9c8ba54 (patch) | |
tree | 113c39dc3249521ebf7d3924f614ea060bcd022b | |
parent | e70c3976db61bfe2038b0d56ea196412215aae4f (diff) | |
download | dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar.gz dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar.bz2 dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar.lz dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar.xz dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.tar.zst dexon-sol-tools-0402d3de802ba262bb820d582baa157ca9c8ba54.zip |
Move upload_docs_json back to npm script and pass in vars properly.
-rw-r--r-- | packages/0x.js/package.json | 3 | ||||
-rw-r--r-- | packages/0x.js/scripts/postpublish.js | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index 10ace5529..e1f0bb93e 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -14,7 +14,8 @@ "scripts": { "prebuild": "npm run clean", "build": "run-p build:umd:prod build:commonjs; exit 0;", - "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $1 $2", + "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", + "upload_docs_json": "aws s3 cp docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json", "lint": "tslint src/**/*.ts test/**/*.ts", "test:circleci": "run-s test:coverage report_test_coverage; if [ $CIRCLE_BRANCH = \"development\" ]; then yarn test:umd; fi", "test": "run-s clean test:commonjs", diff --git a/packages/0x.js/scripts/postpublish.js b/packages/0x.js/scripts/postpublish.js index 1ec0ac258..b9fe0bc9a 100644 --- a/packages/0x.js/scripts/postpublish.js +++ b/packages/0x.js/scripts/postpublish.js @@ -4,6 +4,7 @@ const publishRelease = require('publish-release'); const promisify = require('es6-promisify'); const typedoc = require('typedoc'); +const cwd = __dirname + '/..'; const publishReleaseAsync = promisify(publishRelease); const subPackageName = '0x.js'; const githubPersonalAccessToken = process.env.GITHUB_PERSONAL_ACCESS_TOKEN_0X_JS; @@ -34,9 +35,9 @@ getLatestTagAndVersionAsync(subPackageName) console.log('POSTPUBLISH: Release successful, generating docs...'); return execAsync( - 'yarn docs:json ' + __dirname + '/../docs/index.json ' + __dirname + '/..', + 'JSON_FILE_PATH=' + __dirname + '/../docs/index.json PROJECT_DIR=' + __dirname + '/.. yarn docs:json', { - cwd: __dirname + '/..', + cwd, } ); }) @@ -47,7 +48,9 @@ getLatestTagAndVersionAsync(subPackageName) const fileName = 'v' + version + '.json'; console.log('POSTPUBLISH: Doc generation successful, uploading docs... as ', fileName); const s3Url = 's3://0xjs-docs-jsons/' + fileName; - return execAsync('aws s3 cp ' + __dirname + '/../docs/index.json ' + s3Url + ' --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type aplication/json'); + return execAsync('S3_URL=' + s3Url + ' yarn upload_docs_json', { + cwd, + }); }).catch (function(err) { throw err; }); |