From 454061ece9fd6c7636bb6fd0ea235f45d06f99e2 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sun, 2 Apr 2023 18:14:48 +0300 Subject: [PATCH] fix protocol handler on unix on Windows the arg gets appended with `/` but not on Unix --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index dcc23eb7..0d403e00 100644 --- a/index.js +++ b/index.js @@ -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;