mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-15 12:21:47 +00:00
lint
This commit is contained in:
6
index.js
6
index.js
@ -263,12 +263,12 @@ app.on("ready", () => {
|
|||||||
try { // check if shortcut is registered and valid
|
try { // check if shortcut is registered and valid
|
||||||
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
|
const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet
|
||||||
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {
|
if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) {
|
||||||
throw undefined;
|
throw "needUpdate";
|
||||||
}
|
}
|
||||||
} catch { // if not valid -> Register shortcut
|
} catch (error) { // if not valid -> Register shortcut
|
||||||
electron.shell.writeShortcutLink(
|
electron.shell.writeShortcutLink(
|
||||||
shortcutPath,
|
shortcutPath,
|
||||||
"create",
|
error === "needUpdate" ? "update" : "create",
|
||||||
{
|
{
|
||||||
target: appLocation,
|
target: appLocation,
|
||||||
cwd: appLocation.slice(0, appLocation.lastIndexOf(path.sep)),
|
cwd: appLocation.slice(0, appLocation.lastIndexOf(path.sep)),
|
||||||
|
|||||||
Reference in New Issue
Block a user