aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Tomalka <olaf@tomalka.me>2018-01-31 07:41:58 +0800
committerOlaf Tomalka <olaf@tomalka.me>2018-01-31 07:41:58 +0800
commitfa35768fc9647c475f8132c6b431102a30b4efe1 (patch)
tree62e78203ac5c5b6a372bbb47ef3a269b4531bd01
parentf37fcc147ccc45a234b062217321d26424c85a40 (diff)
downloaddexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar.gz
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar.bz2
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar.lz
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar.xz
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.tar.zst
dexon-sol-tools-fa35768fc9647c475f8132c6b431102a30b4efe1.zip
Removed deprecated CLI options
-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);