From 3c32f98f71996057dcbec770c351465fe8ae588b Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 28 May 2018 12:49:44 -0400 Subject: [PATCH] change ipfs to spawn too --- lib/cmds/blockchain/blockchain.js | 2 +- lib/i18n/locales/en.json | 5 ++++- lib/processes/storageProcesses/ipfs.js | 12 +++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lib/cmds/blockchain/blockchain.js b/lib/cmds/blockchain/blockchain.js index e4da507d..ae83d0f8 100644 --- a/lib/cmds/blockchain/blockchain.js +++ b/lib/cmds/blockchain/blockchain.js @@ -6,7 +6,7 @@ const fs = require('../../core/fs.js'); const GethCommands = require('./geth_commands.js'); -/*eslint complexity: ["error", 35]*/ +/*eslint complexity: ["error", 36]*/ var Blockchain = function(options) { this.blockchainConfig = options.blockchainConfig; this.env = options.env || 'development'; diff --git a/lib/i18n/locales/en.json b/lib/i18n/locales/en.json index 2ff73ceb..2ec0df1b 100644 --- a/lib/i18n/locales/en.json +++ b/lib/i18n/locales/en.json @@ -139,5 +139,8 @@ "For more info go to http://embark.status.im": "For more info go to http://embark.status.im", "%s is not installed on your machine": "%s is not installed on your machine", "You can install it by visiting: %s": "You can install it by visiting: %s", - "IPFS node is offline": "IPFS node is offline" + "IPFS node is offline": "IPFS node is offline", + "Starting ipfs process": "Starting ipfs process", + "ipfs process started": "ipfs process started", + "IPFS node detected": "IPFS node detected" } \ No newline at end of file diff --git a/lib/processes/storageProcesses/ipfs.js b/lib/processes/storageProcesses/ipfs.js index 963828c0..8093584e 100644 --- a/lib/processes/storageProcesses/ipfs.js +++ b/lib/processes/storageProcesses/ipfs.js @@ -1,4 +1,4 @@ -const shelljs = require('shelljs'); +const child_process = require('child_process'); const ProcessWrapper = require('../../process/processWrapper'); const constants = require('../../constants'); @@ -13,7 +13,7 @@ class IPFSProcess extends ProcessWrapper { } checkIPFSVersion() { - shelljs.exec('ipfs --version', {silent: true}, (err, stdout, _stderr) => { + child_process.exec('ipfs --version', {silent: true}, (err, stdout, _stderr) => { if (err) { console.error(err); return; @@ -31,13 +31,7 @@ class IPFSProcess extends ProcessWrapper { startIPFSDaemon() { const self = this; - const child = shelljs.exec('ipfs daemon', {silent: true}, (err, _stdout, _stderr) => { - if (err) { - console.error(err); - process.exit(1); - } - process.exit(); - }); + const child = child_process.spawn('ipfs', ['daemon']); let lastMessage; child.stdout.on('data', (data) => { if (!self.readyCalled && data.indexOf('Daemon is ready') > -1) {