Skip to content

Commit

Permalink
process array
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienChampagnol committed Sep 19, 2024
1 parent 042cec0 commit 9dbef9f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ process.env["ELECTRON_DISABLE_SECURITY_WARNINGS"] = "true";

const data_folder_path = `${os.tmpdir()}/vease/`;

var processes = [];

async function getAvailablePort(port) {
const available_port = await getPort({ port });
console.log("available_port", available_port);
Expand Down Expand Up @@ -73,6 +75,7 @@ async function run_script(
break;
}
});
processes.push(child);
});
}

Expand Down Expand Up @@ -115,7 +118,7 @@ app.whenReady().then(() => {
console.log("BACK PORT", port);
var command;
if (process.platform === "win32") {
command = "resources/geodeapp_back.exe";
command = ".\\resources\\geodeapp_back.exe";
} else if (process.platform === "linux") {
command = "./resources/geodeapp_back";
}
Expand All @@ -139,7 +142,7 @@ app.whenReady().then(() => {
console.log("VIEWER PORT", port);
var command;
if (process.platform === "win32") {
command = "resources/geodeapp_viewer.exe";
command = ".\\resources\\geodeapp_viewer.exe";
} else if (process.platform === "linux") {
command = "./resources/geodeapp_viewer";
}
Expand All @@ -161,6 +164,14 @@ app.whenReady().then(() => {
}
});

// App close handler
app.on('before-quit', function() {
// processes.forEach(function(proc) {
// console.log( 'Process %s has been killed!', proc );
// proc.kill();
// });
});

// Quit when all windows are closed.
app.on("window-all-closed", () => {
app.quit();
Expand Down

0 comments on commit 9dbef9f

Please sign in to comment.