parent
f9c1c94ae9
commit
a353dd6972
@ -0,0 +1,43 @@ |
||||
var which = require('which') |
||||
|
||||
var geth = null |
||||
var eth = null |
||||
|
||||
try { |
||||
geth = which.sync('geth') |
||||
} catch (e) { |
||||
} |
||||
|
||||
try { |
||||
eth = which.sync('eth') |
||||
} catch (e) { |
||||
} |
||||
if (process.argv.length > 2) { |
||||
if (geth && process.argv[2] === 'geth') { |
||||
runGeth() |
||||
} else if (eth && process.argv[2] === 'eth') { |
||||
runEth() |
||||
} |
||||
} else if (geth && eth) { |
||||
console.log('both eth and geth has been found in your system') |
||||
console.log('restart the command with the desired client:') |
||||
console.log('npm run start_eth') |
||||
console.log('or') |
||||
console.log('npm run start_geth') |
||||
} else if (geth) { |
||||
runGeth() |
||||
} else if (eth) { |
||||
runEth() |
||||
} else { |
||||
console.log('neither eth or geth has been found in your system') |
||||
} |
||||
|
||||
function runEth () { |
||||
console.log('starting eth...') |
||||
process.exit(20) |
||||
} |
||||
|
||||
function runGeth () { |
||||
console.log('starting geth...') |
||||
process.exit(21) |
||||
} |
@ -1,20 +0,0 @@ |
||||
0 info it worked if it ends with ok |
||||
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'config', 'get', 'prefix' ] |
||||
2 info using npm@3.8.6 |
||||
3 info using node@v5.12.0 |
||||
4 verbose exit [ 0, true ] |
||||
5 verbose stack Error: write EPIPE |
||||
5 verbose stack at exports._errnoException (util.js:893:11) |
||||
5 verbose stack at WriteWrap.afterWrite (net.js:783:14) |
||||
6 verbose cwd /home/yann/Ethereum/remix/fea1/remix |
||||
7 error Linux 3.16.0-30-generic |
||||
8 error argv "/usr/bin/nodejs" "/usr/bin/npm" "config" "get" "prefix" |
||||
9 error node v5.12.0 |
||||
10 error npm v3.8.6 |
||||
11 error code EPIPE |
||||
12 error errno EPIPE |
||||
13 error syscall write |
||||
14 error write EPIPE |
||||
15 error If you need help, you may report this error at: |
||||
15 error <https://github.com/npm/npm/issues> |
||||
16 verbose exit [ 1, true ] |
@ -0,0 +1,14 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
node findClient.js $1 |
||||
RUNCLIENT=$? |
||||
if [ $RUNCLIENT -eq '20' ] |
||||
then |
||||
npm run start_eth |
||||
fi |
||||
|
||||
if [ $RUNCLIENT -eq '21' ] |
||||
then |
||||
echo $? |
||||
npm run start_geth |
||||
fi |
Loading…
Reference in new issue