aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen/src/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/abi-gen/src/index.ts')
-rw-r--r--packages/abi-gen/src/index.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts
index 0d053cdd1..c49f9dfa7 100644
--- a/packages/abi-gen/src/index.ts
+++ b/packages/abi-gen/src/index.ts
@@ -8,6 +8,7 @@ import { sync as globSync } from 'glob';
import * as Handlebars from 'handlebars';
import * as _ from 'lodash';
import * as mkdirp from 'mkdirp';
+import * as rimraf from 'rimraf';
import * as yargs from 'yargs';
import toSnakeCase = require('to-snake-case');
@@ -72,9 +73,7 @@ function registerPartials(partialsGlob: string): void {
function writeOutputFile(name: string, renderedTsCode: string): void {
let fileName = toSnakeCase(name);
- if (fileName === 'z_r_x_token') {
- fileName = 'zrx_token';
- }
+ fileName = fileName.replace('z_r_x', 'zrx').replace('e_r_c', 'erc');
const filePath = `${args.output}/${fileName}.ts`;
fs.writeFileSync(filePath, renderedTsCode);
logUtils.log(`Created: ${chalk.bold(filePath)}`);
@@ -96,6 +95,7 @@ if (_.isEmpty(abiFileNames)) {
process.exit(1);
} else {
logUtils.log(`Found ${chalk.green(`${abiFileNames.length}`)} ${chalk.bold('ABI')} files`);
+ rimraf.sync(args.output);
mkdirp.sync(args.output);
}
for (const abiFileName of abiFileNames) {