From e9b4179af9d0d8f0da2f6030ffad904ea5c82f10 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 26 Jun 2018 16:08:08 -0400 Subject: [PATCH] use right path depending of os --- lib/cmds/blockchain/blockchain.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index e13e5034..a8d78c49 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -197,10 +197,17 @@ Blockchain.prototype.readyCallback = function() { } const NetcatClient = require('netcat/client'); + const isWin = process.platform === "win32"; + let ipcPath; + if (isWin) { + ipcPath = '\\\\.\\pipe\\geth.ipc'; + } else { + ipcPath = self.datadir + '/geth.ipc'; + } - var nc2 = new NetcatClient(); - nc2.unixSocket('/home/jonathan/dapp-bin/embark_demo/.embark/development/datadir/geth.ipc') + const nc2 = new NetcatClient(); + nc2.unixSocket(ipcPath) .enc('utf8') .on('data', function(res){ console.log(res);