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 Apr 3, 2022
1 parent 2b48044 commit fd7ce1b
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 @@ -261,6 +261,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 !== '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 fd7ce1b

Please sign in to comment.