use right path depending of os

This commit is contained in:
Jonathan Rainville 2018-06-26 16:08:08 -04:00 committed by Iuri Matias
parent f49e79d4e2
commit 1970f8fc53
1 changed files with 9 additions and 2 deletions

View File

@ -214,10 +214,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);