-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.js
48 lines (41 loc) · 1.1 KB
/
main.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const { app, BrowserWindow, dialog } = require('electron');
//const { spawn } = require('child_process');
const execFile = require('child_process').execFile;
const path = require('path');
const MAIN_URL = 'http://localhost:8000';
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
});
// and load the index.html of the app.
win.loadURL(MAIN_URL);
}
var lispProcess = null;
function runapp () {
lispExePath = path.resolve(__dirname, "lispapp.exe");
console.log(lispExePath);
// lispProcess = spawn(lispExePath, [], { cwd: __dirname, shell: true});
lispProcess = execFile(lispExePath, function(err, data) {
if(err) {
console.error(err);
return;
}
console.log("\n");
console.log(data.toString());
});
createWindow();
}
function quit() {
if (lispProcess !== null) {
lispProcess.kill("SIGKILL");
lispProcess = null;
}
app.exit(0);
}
app.on("ready", runapp);
app.on("quit", quit);