Merge pull request #1099 from Araxeus/fix-protocol-handler-on-unix

fix protocol handler on unix
This commit is contained in:
th-ch
2023-04-02 21:25:07 +02:00
committed by GitHub

View File

@ -381,7 +381,8 @@ app.on("ready", () => {
const uri = `${APP_PROTOCOL}://`;
const protocolArgv = commandLine.find(arg => arg.startsWith(uri));
if (protocolArgv) {
const command = protocolArgv.slice(uri.length, -1);
const lastIndex = protocolArgv.endsWith("/") ? -1 : undefined;
const command = protocolArgv.slice(uri.length, lastIndex);
if (is.dev()) console.debug(`Received command over protocol: "${command}"`);
handleProtocol(command);
return;