diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-06 00:59:13 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-12-06 00:59:13 +0800 |
commit | 9891d7aaa6ce0148b87c49b534b0baa678b813d0 (patch) | |
tree | 11a1b6f14061279b058aed67fa252b1b6279c775 /packages | |
parent | 1ce66b4a81b736f5288463be609a902af64cbe77 (diff) | |
download | dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar.gz dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar.bz2 dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar.lz dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar.xz dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.tar.zst dexon-sol-tools-9891d7aaa6ce0148b87c49b534b0baa678b813d0.zip |
Make fileExtension configurable
Diffstat (limited to 'packages')
-rw-r--r-- | packages/0x.js/package.json | 2 | ||||
-rw-r--r-- | packages/abi-gen/src/index.ts | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/packages/0x.js/package.json b/packages/0x.js/package.json index b09aadd7e..341b12188 100644 --- a/packages/0x.js/package.json +++ b/packages/0x.js/package.json @@ -16,7 +16,7 @@ "build": "run-p build:umd:prod build:commonjs; exit 0;", "docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_DIR", "upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json", - "generate_contract_wrappers": "abi-gen --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json' --templates ../abi-gen-templates/ --output src/contract_wrappers/generated", + "generate_contract_wrappers": "abi-gen --abiGlob 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry).json' --templates ../abi-gen-templates/ --output src/contract_wrappers/generated --fileExtension ts", "lint": "tslint --project . '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/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts index 19d289e49..12b78f96f 100644 --- a/packages/abi-gen/src/index.ts +++ b/packages/abi-gen/src/index.ts @@ -33,11 +33,16 @@ const args = yargs type: 'string', demand: true, }) + .option('fileExtension', { + describe: 'The extension of the output file', + type: 'string', + demand: true, + }) .argv; function writeOutputFile(name: string, renderedTsCode: string): void { const fileName = toSnakeCase(name); - const filePath = `${args.output}/${fileName}.ts`; + const filePath = `${args.output}/${fileName}.${args.fileExtension}`; fs.writeFileSync(filePath, renderedTsCode); utils.log(`Created: ${chalk.bold(filePath)}`); } |