Skip to content

Commit

Permalink
Add additional validation to find the app-specific argument we require (
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Aug 11, 2024
1 parent 7815c15 commit 5135bb9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/src/main-process/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ function handlePossibleProtocolLauncherArgs(args: ReadonlyArray<string>) {
} else {
log.error(`Malformed launch arguments received: ${args}`)
}
} else if (__LINUX__) {
// we expect this call to have several parameters before the URL we want,
// so we should filter out the program name as well as any parameters that
// look like arguments to Electron
const argsWithoutParameters = args.filter(
a => !a.endsWith('github-desktop') && !a.startsWith('--')
)
if (argsWithoutParameters.length > 0) {
handleAppURL(argsWithoutParameters[0])
}
} else if (args.length > 1) {
handleAppURL(args[1])
}
Expand Down

0 comments on commit 5135bb9

Please sign in to comment.