From 12a033a3f2d70e45c73a16f4e08d234f616fae1a Mon Sep 17 00:00:00 2001 From: cgewecke Date: Sat, 29 Jul 2017 12:44:47 -0700 Subject: [PATCH] Verify testrpc-sc location in node_modules --- lib/app.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/app.js b/lib/app.js index 02bb1e7..e3f5170 100644 --- a/lib/app.js +++ b/lib/app.js @@ -128,10 +128,17 @@ class App { launchTestrpc() { return new Promise((resolve, reject) => { if (!this.norpc) { + let command; + const defaultRpcOptions = `--gasLimit ${gasLimitHex} --accounts ${this.accounts} --port ${this.port}`; const options = this.testrpcOptions || defaultRpcOptions; - const command = './node_modules/ethereumjs-testrpc-sc/build/cli.node.js '; - + const npm = './node_modules/.bin/testrpc-sc'; + const yarn = './node_modules/ethereumjs-testrpc-sc/build/cli.node.js'; + + shell.test('-e', yarn) + ? command = `${yarn} ` + : command = `${npm} `; + // Launch this.testrpcProcess = childprocess.exec(command + options, null, (err, stdout, stderr) => { if (err) {