Skip to content

Commit e99a328

Browse files
jrainvilleiurimatias
authored andcommitted
fix(cmd-controller): fix build --contracts command starting comm node
Fixes #2288 Only start a blockchain node when there is no --contracts flag and start only needed modules for compilation
1 parent 584845b commit e99a328

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/embark/src/cmd/cmd_controller.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,14 @@ class EmbarkController {
291291

292292
engine.registerModuleGroup("compiler");
293293
engine.registerModuleGroup("contracts");
294-
engine.registerModuleGroup("pipeline");
295-
engine.registerModuleGroup("communication");
296-
engine.registerModuleGroup("namesystem");
297-
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
298-
299-
engine.registerModuleGroup("blockchain");
300294

301295
if (!options.onlyCompile) {
296+
engine.registerModuleGroup("blockchain");
297+
engine.registerModuleGroup("namesystem");
302298
engine.registerModuleGroup("storage");
299+
engine.registerModuleGroup("communication");
300+
engine.registerModuleGroup("pipeline");
301+
engine.registerModulePackage('embark-deploy-tracker', { plugins: engine.plugins });
303302
}
304303

305304
// load custom plugins
@@ -311,6 +310,9 @@ class EmbarkController {
311310

312311
let plugin = engine.plugins.createPlugin('cmdcontrollerplugin', {});
313312
plugin.registerActionForEvent("embark:engine:started", async (_, cb) => {
313+
if (options.onlyCompile) {
314+
return cb();
315+
}
314316
try {
315317
await Promise.all([
316318
engine.events.request2("blockchain:node:start", engine.config.blockchainConfig),
@@ -382,8 +384,8 @@ class EmbarkController {
382384
await engine.events.request2("deployment:contracts:deploy", contractsList, contractDependencies);
383385
await engine.events.request2('scripts-runner:initialize');
384386
await engine.events.request2('scripts-runner:execute', options.target, options.forceTracking);
385-
} catch (err) {
386-
return callback(err);
387+
} catch (e) {
388+
return callback(e);
387389
}
388390
callback();
389391
});

0 commit comments

Comments
 (0)