diff --git a/lib/cmds/scaffolding.js b/lib/cmds/scaffolding.js index 57d8ea86..c7eae44c 100644 --- a/lib/cmds/scaffolding.js +++ b/lib/cmds/scaffolding.js @@ -34,8 +34,7 @@ class Scaffolding { } const contract = contractConfiguration.contracts[contractName]; - const result = build(contract); - this.embark.logger.info(result); + build(contract); } } diff --git a/lib/modules/scaffolding-react/index.js b/lib/modules/scaffolding-react/index.js index af125c72..5522c019 100644 --- a/lib/modules/scaffolding-react/index.js +++ b/lib/modules/scaffolding-react/index.js @@ -10,25 +10,22 @@ Handlebars.registerHelper('ifview', function(stateMutability, options) { let result = stateMutability == 'view' || stateMutability == 'pure' || stateMutability == 'constant'; if (result) { return options.fn(this); - } else { - return options.inverse(this); - } + } + return options.inverse(this); }); Handlebars.registerHelper('ifeq', function(elem, value, options){ if (elem == value) { return options.fn(this); - } else { - return options.inverse(this); } + return options.inverse(this); }); Handlebars.registerHelper('iflengthgt', function(arr, val, options) { if (arr.length > val) { return options.fn(this); - } else { - return options.inverse(this); - } + } + return options.inverse(this); }); Handlebars.registerHelper('emptyname', function(name, index) { @@ -40,9 +37,8 @@ Handlebars.registerHelper('methodname', function(abiDefinition, functionName, in let funCount = abiDefinition.filter(x => x.name == functionName).length; if(funCount == 1){ return '.' + functionName; - } else { - return new Handlebars.SafeString(`['${functionName}(${inputs !== null ? inputs.map(input => input.type).join(',') : '' })']`); } + return new Handlebars.SafeString(`['${functionName}(${inputs !== null ? inputs.map(input => input.type).join(',') : ''})']`); }); class ScaffoldingReact { @@ -78,7 +74,7 @@ class ScaffoldingReact { }); } - build(contract){ + async build(contract){ this._buildHTML(contract); const filename = contract.className.toLowerCase(); @@ -98,7 +94,7 @@ class ScaffoldingReact { fs.writeFileSync("./embark.json", JSON.stringify(embarkJson, null, 4)); - return filename + ".html generated"; + this.embark.logger.info(filename + ".html generated"); } }