mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
fix protocol handler on unix
on Windows the arg gets appended with `/` but not on Unix
This commit is contained in:
3
index.js
3
index.js
@ -381,7 +381,8 @@ app.on("ready", () => {
|
|||||||
const uri = `${APP_PROTOCOL}://`;
|
const uri = `${APP_PROTOCOL}://`;
|
||||||
const protocolArgv = commandLine.find(arg => arg.startsWith(uri));
|
const protocolArgv = commandLine.find(arg => arg.startsWith(uri));
|
||||||
if (protocolArgv) {
|
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}"`);
|
if (is.dev()) console.debug(`Received command over protocol: "${command}"`);
|
||||||
handleProtocol(command);
|
handleProtocol(command);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user