Fix CLI logic for Linux / Windows

This commit is contained in:
Preston 2020-12-18 17:24:15 -05:00
parent a3e7ad32bb
commit 52c5dc5322
1 changed files with 6 additions and 6 deletions

View File

@ -306,7 +306,8 @@ app.on('open-url', (event, url) => {
})
/*
* Check if we were passed a freetube:// URL on process startup (linux/win)
* Check if an argument was passed and send it over to the GUI (Linux / Windows).
* Remove freetube:// protocol if present
*/
const url = getLinkUrl(process.argv)
if (url) {
@ -318,12 +319,11 @@ function baseUrl(arg) {
}
function getLinkUrl(argv) {
for (const arg of argv) {
if (arg.indexOf('freetube://') !== -1) {
return baseUrl(arg)
}
}
if (argv.length > 0) {
return baseUrl(argv[argv.length - 1])
} else {
return null
}
}
/**