From 3b736f56a7ef9c4edb9a6c9bbabcd709b26d477b Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Thu, 26 Apr 2018 14:15:43 -0400 Subject: [PATCH] don't error if it's an empty dapp with no contracts yet --- lib/contracts/compiler.js | 4 ++++ lib/contracts/deploy.js | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/contracts/compiler.js b/lib/contracts/compiler.js index fa474e523..8699b842c 100644 --- a/lib/contracts/compiler.js +++ b/lib/contracts/compiler.js @@ -10,6 +10,10 @@ class Compiler { const self = this; let available_compilers = {}; + if (contractFiles.length === 0) { + return cb(null, {}); + } + let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers'); pluginCompilers.forEach(function (compilerObject) { available_compilers[compilerObject.extension] = compilerObject.cb; diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index d1b87ade3..7cfb7b16e 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -352,8 +352,9 @@ class Deploy { deployAll(done) { let self = this; this.logger.info("deploying contracts"); + let contracts = this.contractsManager.listContracts(); - async.eachOfSeries(this.contractsManager.listContracts(), + async.eachOfSeries(contracts, function (contract, key, callback) { self.logger.trace(arguments); self.checkAndDeployContract(contract, null, callback); @@ -364,6 +365,10 @@ class Deploy { self.logger.error(err.message); self.logger.debug(err.stack); } + if (contracts.length === 0) { + self.logger.info("no contracts found"); + return done(); + } self.logger.info("finished deploying contracts"); self.logger.trace(arguments); done(err);