don't error if it's an empty dapp with no contracts yet

This commit is contained in:
Iuri Matias 2018-04-26 14:15:43 -04:00
parent c77d52c926
commit 3b736f56a7
2 changed files with 10 additions and 1 deletions

View File

@ -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;

View File

@ -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);