Commit 756f4da4 authored by dev0tion's avatar dev0tion

Kill API process

parent 14dca061
...@@ -9,6 +9,8 @@ const path = require('path'); ...@@ -9,6 +9,8 @@ const path = require('path');
const url = require('url'); const url = require('url');
const os = require('os'); const os = require('os');
var apiProcess;
let serve; let serve;
const args = process.argv.slice(1); const args = process.argv.slice(1);
serve = args.some(val => val === "--serve"); serve = args.some(val => val === "--serve");
...@@ -66,6 +68,7 @@ app.on('window-all-closed', function () { ...@@ -66,6 +68,7 @@ app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar // On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q // to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
apiProcess.kill();
app.quit(); app.quit();
} }
}); });
...@@ -79,16 +82,15 @@ app.on('activate', function () { ...@@ -79,16 +82,15 @@ app.on('activate', function () {
}); });
function startApi() { function startApi() {
var apiProcess; const exec = require('child_process').exec;
const spawn = require('child_process').spawn;
//Start Breeze Daemon //Start Breeze Daemon
let apipath = path.join(__dirname, '..//..//daemon//Breeze.Daemon'); let apipath = path.join(__dirname, './/assets//daemon//Breeze.Daemon');
if (os.platform() === 'win32') { if (os.platform() === 'win32') {
apipath = path.join(__dirname, '.\\assets\\daemon\\Breeze.Daemon.exe'); apipath = path.join(__dirname, '.\\assets\\daemon\\Breeze.Daemon.exe');
} }
apiProcess = spawn(apipath + ' light -testnet', { apiProcess = exec(apipath + ' light -testnet', {
detached: true detached: true
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment