Skip to content

Commit fa816b8

Browse files
Add support for UI launch in the launcher and entry point script
1 parent c68e1ed commit fa816b8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,9 @@ async function main() {
822822

823823

824824
} // End of main function
825-
825+
// --ui adds fix to the launcher (when the ui launches, it returns ui_index.cjs as the entry point script, which will trigger module logic, which is now fixed)
826826
const entryPointScript = process.argv[1].split(path.sep).pop();
827-
if (entryPointScript === __filename || entryPointScript === __dirname.split(path.sep).pop()) {
827+
if (entryPointScript === __filename || entryPointScript === __dirname.split(path.sep).pop() || (process.argv.length == 3 && process.argv[2] == "--ui")) {
828828
main().catch(error => {
829829
console.error("\n--- An error occurred during setup or launch ---");
830830
console.error(error);

ui_index.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const createConsole = () => {
3232
app.whenReady().then(() => {
3333
ipcMain.on('launch', (event, arg) => {
3434
let consoleWin = createConsole();
35-
const process = spawn('node', [mainIndex]);
35+
const process = spawn('node', [mainIndex, "--ui"]);
3636

3737
process.stdout.on('data', (data) => {
3838
consoleWin.webContents.send('msg', String(data)); // Send to renderer

0 commit comments

Comments
 (0)