Skip to content

Commit 58b9ad0

Browse files
committed
Improved argument forwarding
1 parent d9f3da8 commit 58b9ad0

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Changelog.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 0.5.0
1+
# 0.5.1
2+
3+
## ElectronNET.Core
4+
5+
- Fixed slicing of arguments for packaged applications (#1072)
6+
7+
# 0.5.0
28

39
## ElectronNET.Core
410

src/ElectronNET.Host/main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ if (manifestJsonFile.singleInstance) {
133133
// Collect user supplied command line args (excluding those handled by Electron host itself)
134134
function getForwardedArgs() {
135135
const skipSwitches = new Set(['unpackedelectron', 'unpackeddotnet', 'dotnetpacked']);
136-
return process.argv.slice(2).filter(arg => {
136+
const sliceIndex = app.isPackaged ? 1 : 2;
137+
return process.argv.slice(sliceIndex).filter(arg => {
137138
if (!arg) return false;
138139
// Node/Electron internal or we already process them
139140
if (arg.startsWith('--manifest')) return false;

0 commit comments

Comments
 (0)