-
Notifications
You must be signed in to change notification settings - Fork 53
/
odas.js
29 lines (19 loc) · 582 Bytes
/
odas.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
* ODAS Control
*/
exports.odas_process
const electron = require('electron')
const ipcMain = electron.ipcMain
const child_process = require('child_process')
ipcMain.on('launch-odas', function(event, core, config) {
console.log('received launch command')
console.log(core)
console.log(config)
exports.odas_process = child_process.spawn(core, ['-c', config])
event.sender.send('launched-odas', true)
})
ipcMain.on('stop-odas', function(event) {
exports.odas_process.kill('SIGINT')
exports.odas_process = undefined
console.log('received stop command')
})