diff --git a/desktop/app.js b/desktop/app.js index 21376be4..3d6770a3 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -567,20 +567,35 @@ function setUserDataPaths() { perfTimestamps?.push({ name: 'portable check', ts: process.hrtime() }); + // eslint-disable-next-line no-console + console.log('Is portable:', isPortable); + if (isPortable) { const portableConfigDir = path.dirname(execPath); const portableConfigPath = path.join(portableConfigDir, portableConfigFileName); + // eslint-disable-next-line no-console + console.log('Portable config path:', portableConfigPath); + if (fs.existsSync(portableConfigPath)) { + // eslint-disable-next-line no-console + console.log('Portable config path exists'); + const portableConfig = JSON.parse(fs.readFileSync(portableConfigPath, 'utf8')); const portableUserDataDir = path.resolve(portableConfigDir, portableConfig.userDataDir); + // eslint-disable-next-line no-console + console.log('Portable user data dir:', portableUserDataDir); + if (!fs.existsSync(portableUserDataDir)) { fs.mkdirSync(portableUserDataDir); } app.setPath('userData', portableUserDataDir); usingPortableUserDataDir = true; + } else { + // eslint-disable-next-line no-console + console.log(`Portable config path doesn't exist`); } }