Merge pull request #620 from embark-framework/features/bin-entry-ganache-cli

Features/bin entry ganache cli
This commit is contained in:
Iuri Matias 2018-07-11 21:27:26 +03:00 committed by GitHub
commit ff7a4bd1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

View File

@ -12,13 +12,14 @@ class Simulator {
run(options) {
let cmds = [];
const testrpc = shelljs.which('testrpc');
const ganache = shelljs.which('ganache-cli');
if (!testrpc && !ganache) {
this.logger.warn(__('%s is not installed on your machine', 'Ganache CLI (TestRPC)'));
this.logger.info(__('You can install it by running: %s', 'npm -g install ganache-cli'));
process.exit();
}
const ganache = shelljs.which('ganache-cli-embark');
// const testrpc = shelljs.which('testrpc');
// const ganache = shelljs.which('ganache-cli');
// if (!testrpc && !ganache) {
// this.logger.warn(__('%s is not installed on your machine', 'Ganache CLI (TestRPC)'));
// this.logger.info(__('You can install it by running: %s', 'npm -g install ganache-cli'));
// process.exit();
// }
let useProxy = this.blockchainConfig.proxy || false;
let host = (options.host || this.blockchainConfig.rpcHost || 'localhost');
@ -44,8 +45,11 @@ class Simulator {
cmds.push("-b \"" + (simulatorBlocktime) +"\"");
}
const program = ganache ? 'ganache-cli' : 'testrpc';
console.log(`running: ${program} ${cmds.join(' ')}`);
// const programName = ganache ? 'ganache-cli' : 'testrpc';
// const program = ganache ? ganache : testrpc;
const programName = 'ganache-cli';
const program = ganache;
console.log(`running: ${programName} ${cmds.join(' ')}`);
shelljs.exec(`${program} ${cmds.join(' ')}`, {async : true});
if(useProxy){

View File

@ -10,7 +10,8 @@
"fulltest": "npm run lint && npm run test && npm run testdapp_1 && npm run testdapp_2"
},
"bin": {
"embark": "./bin/embark"
"embark": "./bin/embark",
"ganache-cli-embark": "./node_modules/.bin/ganache-cli"
},
"main": "./lib/index.js",
"directories": {