Skip to content

Commit c8a6da5

Browse files
committed
Move custom_main.js handling to execute before checking command line switches
1 parent 8009348 commit c8a6da5

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/ElectronNET.Host/main.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,6 @@ let unpackeddotnet = false;
2424
let dotnetpacked = false;
2525
let electronforcedport;
2626

27-
if (app.commandLine.hasSwitch('manifest')) {
28-
manifestJsonFileName = app.commandLine.getSwitchValue('manifest');
29-
}
30-
31-
console.log('Entry!!!: ');
32-
33-
if (app.commandLine.hasSwitch('unpackedelectron')) {
34-
unpackedelectron = true;
35-
}
36-
else if (app.commandLine.hasSwitch('unpackeddotnet')) {
37-
unpackeddotnet = true;
38-
}
39-
else if (app.commandLine.hasSwitch('dotnetpacked')) {
40-
dotnetpacked = true;
41-
}
42-
43-
if (app.commandLine.hasSwitch('electronforcedport')) {
44-
electronforcedport = app.commandLine.getSwitchValue('electronforcedport');
45-
}
46-
4727
// Custom startup hook: look for custom_main.js and invoke its onStartup(host) if present.
4828
// If the hook returns false, abort Electron startup.
4929
try {
@@ -67,6 +47,26 @@ try {
6747
console.error('Error while executing custom_main.js:', err);
6848
}
6949

50+
if (app.commandLine.hasSwitch('manifest')) {
51+
manifestJsonFileName = app.commandLine.getSwitchValue('manifest');
52+
}
53+
54+
console.log('Entry!!!: ');
55+
56+
if (app.commandLine.hasSwitch('unpackedelectron')) {
57+
unpackedelectron = true;
58+
}
59+
else if (app.commandLine.hasSwitch('unpackeddotnet')) {
60+
unpackeddotnet = true;
61+
}
62+
else if (app.commandLine.hasSwitch('dotnetpacked')) {
63+
dotnetpacked = true;
64+
}
65+
66+
if (app.commandLine.hasSwitch('electronforcedport')) {
67+
electronforcedport = app.commandLine.getSwitchValue('electronforcedport');
68+
}
69+
7070
const currentPath = __dirname;
7171
let currentBinPath = path.join(currentPath.replace('app.asar', ''), 'bin');
7272
let manifestJsonFilePath = path.join(currentPath, manifestJsonFileName);

0 commit comments

Comments
 (0)