From 9891d7aaa6ce0148b87c49b534b0baa678b813d0 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 5 Dec 2017 19:59:13 +0300 Subject: Make fileExtension configurable --- packages/abi-gen/src/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'packages/abi-gen') 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)}`); } -- cgit v1.2.3