remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/remix-debugger/findClient.js

44 lines
852 B

8 years ago
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)
}