aboutsummaryrefslogtreecommitdiffstats
path: root/packages/abi-gen/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/abi-gen/src')
-rw-r--r--packages/abi-gen/src/index.ts21
1 files changed, 2 insertions, 19 deletions
diff --git a/packages/abi-gen/src/index.ts b/packages/abi-gen/src/index.ts
index 3628adff8..5412d11ce 100644
--- a/packages/abi-gen/src/index.ts
+++ b/packages/abi-gen/src/index.ts
@@ -17,11 +17,9 @@ import { utils } from './utils';
const ABI_TYPE_CONSTRUCTOR = 'constructor';
const ABI_TYPE_METHOD = 'function';
const ABI_TYPE_EVENT = 'event';
-const MAIN_TEMPLATE_NAME = 'contract.mustache';
const args = yargs
.option('abis', {
- alias: ['abiGlob'],
describe: 'Glob pattern to search for ABI JSON files',
type: 'string',
demandOption: true,
@@ -41,20 +39,9 @@ const args = yargs
.option('template', {
describe: 'Path for the main template file that will be used to generate each contract',
type: 'string',
+ demandOption: true,
normalize: true,
})
- .group(['templates'], 'Deprecated')
- .option('templates', {
- describe: 'Folder where to search for templates',
- type: 'string',
- })
- .conflicts('templates', ['partials', 'template-file'])
- .check(argv => {
- if (!argv.template && !argv.templates) {
- throw new Error('You need specify the location of the template');
- }
- return true;
- })
.example("$0 --abis 'src/artifacts/**/*.json' --out 'src/contracts/generated/' --partials 'src/templates/partials/**/*.handlebars' --template 'src/templates/contract.handlebars'", 'Full usage example')
.argv;
@@ -81,11 +68,7 @@ Handlebars.registerHelper('returnType', utils.solTypeToTsType.bind(utils, ParamK
if (args.partials) {
registerPartials(args.partials);
}
-if (args.templates) {
- registerPartials(`${args.templates}/partials/**/*.{mustache,handlebars}`);
-}
-
-const mainTemplate = utils.getNamedContent(args.template ? args.template : `${args.templates}/${MAIN_TEMPLATE_NAME}`);
+const mainTemplate = utils.getNamedContent(args.template);
const template = Handlebars.compile<ContextData>(mainTemplate.content);
const abiFileNames = globSync(args.abis);