From 6c03a2e212f26065d62d91a9e38885a1a7d9d9f0 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 4 Jul 2018 16:10:12 +0300 Subject: [PATCH 1/3] ignore stderr since geth outputs normal logs to it --- lib/cmds/blockchain/blockchain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 25a2b2f36..187f3c4e4 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -194,7 +194,7 @@ Blockchain.prototype.checkPathLength = function() { Blockchain.prototype.isClientInstalled = function(callback) { let versionCmd = this.client.determineVersionCommand(); this.runCommand(versionCmd, {}, (err, stdout, stderr) => { - if (err || stderr || !stdout || stdout.indexOf("not found") >= 0) { + if (err || !stdout || stdout.indexOf("not found") >= 0) { return callback('Geth not found'); } callback(); From a7a6a62edc5cb072c5b2ba7c44025a63a75286fa Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 4 Jul 2018 16:36:49 +0300 Subject: [PATCH 2/3] make linter happy --- lib/cmds/blockchain/blockchain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 187f3c4e4..1e6f5396f 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -193,7 +193,7 @@ Blockchain.prototype.checkPathLength = function() { Blockchain.prototype.isClientInstalled = function(callback) { let versionCmd = this.client.determineVersionCommand(); - this.runCommand(versionCmd, {}, (err, stdout, stderr) => { + this.runCommand(versionCmd, {}, (err, stdout, _stderr) => { if (err || !stdout || stdout.indexOf("not found") >= 0) { return callback('Geth not found'); } From 289be4b8a46c9551654db45ef1ee4661e1fc3867 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 4 Jul 2018 16:40:46 +0300 Subject: [PATCH 3/3] check for cmd not found in stderr --- lib/cmds/blockchain/blockchain.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index 1e6f5396f..a5100def0 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -193,8 +193,8 @@ Blockchain.prototype.checkPathLength = function() { Blockchain.prototype.isClientInstalled = function(callback) { let versionCmd = this.client.determineVersionCommand(); - this.runCommand(versionCmd, {}, (err, stdout, _stderr) => { - if (err || !stdout || stdout.indexOf("not found") >= 0) { + this.runCommand(versionCmd, {}, (err, stdout, stderr) => { + if (err || !stdout || stderr.indexOf("not found") >= 0 || stdout.indexOf("not found") >= 0) { return callback('Geth not found'); } callback();