From 5f01bbd9e08ae1d6e2ca08d2f8ea1958e28787c4 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 15 Jul 2020 11:41:30 +0100 Subject: [PATCH] Fix lint error --- src/electron-main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/electron-main.js b/src/electron-main.js index 9547d9a..68eaba9 100644 --- a/src/electron-main.js +++ b/src/electron-main.js @@ -99,6 +99,13 @@ if (argv["help"]) { app.exit(); } +// Electron creates the user data directory (with just an empty 'Dictionaries' directory...) +// as soon as the app path is set, so pick a random path in it that must exist if it's a +// real user data directory. +function isRealUserDataDir(d) { + return fs.existsSync(path.join(d, 'IndexedDB')); +} + // check if we are passed a profile in the SSO callback url let userDataPath; @@ -114,12 +121,6 @@ if (userDataPathInProtocol) { if (argv['profile']) { newUserDataPath += '-' + argv['profile']; } - // Electron creates the user data directory (with just an empty 'Dictionaries' directory...) - // as soon as the app path is set, so pick a random path in it that must exist if it's a - // real user data directory. - function isRealUserDataDir(d) { - return fs.existsSync(path.join(d, 'IndexedDB')); - } const newUserDataPathExists = isRealUserDataDir(newUserDataPath); const oldUserDataPath = path.join(app.getPath('appData'), 'Riot'); const oldUserDataPathExists = isRealUserDataDir(oldUserDataPath);