Sitelet https://github.com/shiftkey/desktop/commit/9bc49d06ed83c56f3c474939140a8df13d59b34b
Skip to content

Commit 9bc49d0

Browse files
committed
Add additional validation to find the app-specific argument we require (#687 #689)
1 parent 7dcb7ca commit 9bc49d0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎app/src/main-process/main.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ function handlePossibleProtocolLauncherArgs(args: ReadonlyArray<string>) {
269269
} else {
270270
log.error(`Malformed launch arguments received: ${args}`)
271271
}
272+
} else if (__LINUX__) {
273+
// we expect this call to have several parameters before the URL we want,
274+
// so we should filter out the program name as well as any parameters that
275+
// look like arguments to Electron
276+
const argsWithoutParameters = args.filter(
277+
a => !a.endsWith('github-desktop') && !a.startsWith('--')
278+
)
279+
if (argsWithoutParameters.length > 0) {
280+
handleAppURL(argsWithoutParameters[0])
281+
}
272282
} else if (args.length > 1) {
273283
handleAppURL(args[1])
274284
}

0 commit comments

Comments
 (0)