Merge pull request #383 from embark-framework/no_contracts

don't error if it's an empty dapp with no contracts yet
This commit is contained in:
Iuri Matias 2018-04-26 14:56:13 -04:00 committed by GitHub
commit 6a3add8e04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);