Skip to content

Commit 3b736f5

Browse files
committed
don't error if it's an empty dapp with no contracts yet
1 parent c77d52c commit 3b736f5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/contracts/compiler.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ class Compiler {
1010
const self = this;
1111
let available_compilers = {};
1212

13+
if (contractFiles.length === 0) {
14+
return cb(null, {});
15+
}
16+
1317
let pluginCompilers = self.plugins.getPluginsProperty('compilers', 'compilers');
1418
pluginCompilers.forEach(function (compilerObject) {
1519
available_compilers[compilerObject.extension] = compilerObject.cb;

lib/contracts/deploy.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,9 @@ class Deploy {
352352
deployAll(done) {
353353
let self = this;
354354
this.logger.info("deploying contracts");
355+
let contracts = this.contractsManager.listContracts();
355356

356-
async.eachOfSeries(this.contractsManager.listContracts(),
357+
async.eachOfSeries(contracts,
357358
function (contract, key, callback) {
358359
self.logger.trace(arguments);
359360
self.checkAndDeployContract(contract, null, callback);
@@ -364,6 +365,10 @@ class Deploy {
364365
self.logger.error(err.message);
365366
self.logger.debug(err.stack);
366367
}
368+
if (contracts.length === 0) {
369+
self.logger.info("no contracts found");
370+
return done();
371+
}
367372
self.logger.info("finished deploying contracts");
368373
self.logger.trace(arguments);
369374
done(err);

0 commit comments

Comments
 (0)