Skip to content

Commit d4ab94e

Browse files
authored
Merge pull request #578 from embark-framework/bug_fix/upload-fail-solc-plugin_3_1
Bug fix/upload fail solc plugin 3 1
2 parents bb21490 + 589589c commit d4ab94e

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

lib/cmds/simulator.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ class Simulator {
2525
let port = (options.port || this.blockchainConfig.rpcPort || 8545);
2626

2727
cmds.push("-p " + (port + (useProxy ? constants.blockchain.servicePortOnProxy : 0)));
28-
cmds.push("-h " + host);
28+
if (!ganache) {
29+
cmds.push("-h " + host);
30+
}
2931
cmds.push("-a " + (options.numAccounts || 10));
3032
cmds.push("-e " + (options.defaultBalance || 100));
3133
cmds.push("-l " + (options.gasLimit || 8000000));
@@ -43,7 +45,7 @@ class Simulator {
4345
}
4446

4547
const program = ganache ? 'ganache-cli' : 'testrpc';
46-
48+
console.log(`running: ${program} ${cmds.join(' ')}`);
4749
shelljs.exec(`${program} ${cmds.join(' ')}`, {async : true});
4850

4951
if(useProxy){

lib/index.js

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ class Embark {
194194
engine.startService("libraryManager");
195195
engine.startService("codeRunner");
196196
engine.startService("web3");
197-
engine.startService("pipeline");
197+
if (!options.onlyCompile) {
198+
engine.startService("pipeline");
199+
}
198200
engine.startService("deployment", {onlyCompile: options.onlyCompile});
199201
engine.startService("storage");
200202
engine.startService("codeGenerator");
@@ -206,21 +208,30 @@ class Embark {
206208
});
207209
},
208210
function waitForWriteFinish(callback) {
211+
if (options.onlyCompile) {
212+
engine.logger.info("Finished compiling".underline);
213+
return callback(null, true);
214+
}
209215
engine.logger.info("Finished deploying".underline);
210-
// Necessary log for simple projects. This event is trigger to soon because there is no file
211-
// Also, not exiting straight after the deploy leaves time for async afterDeploys to finish
212-
engine.logger.info("If you have no files to build, you can exit now with CTRL+C");
213-
engine.events.on('outputDone', callback);
216+
if (!engine.config.assetFiles || !Object.keys(engine.config.assetFiles).length) {
217+
return callback();
218+
}
219+
engine.events.on('outputDone', (err) => {
220+
engine.logger.info(__("finished building").underline);
221+
callback(err, true);
222+
});
214223
}
215-
], function (err, _result) {
224+
], function (err, canExit) {
216225
if (err) {
217226
engine.logger.error(err.message);
218227
engine.logger.debug(err.stack);
219-
} else {
220-
engine.logger.info(__("finished building").underline);
221228
}
222-
// needed due to child processes
223-
process.exit();
229+
230+
if (canExit || !engine.config.contractsConfig.afterDeploy || !engine.config.contractsConfig.afterDeploy.length) {
231+
process.exit();
232+
}
233+
engine.logger.info(__('Waiting for after deploy to finish...'));
234+
engine.logger.info(__('You can exit with CTRL+C when after deploy completes'));
224235
});
225236
}
226237

0 commit comments

Comments
 (0)