mirror of https://github.com/keeweb/keeweb.git
added some logging
This commit is contained in:
parent
65b6fe2e2e
commit
c1a6268c2d
|
@ -567,20 +567,35 @@ function setUserDataPaths() {
|
||||||
|
|
||||||
perfTimestamps?.push({ name: 'portable check', ts: process.hrtime() });
|
perfTimestamps?.push({ name: 'portable check', ts: process.hrtime() });
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('Is portable:', isPortable);
|
||||||
|
|
||||||
if (isPortable) {
|
if (isPortable) {
|
||||||
const portableConfigDir = path.dirname(execPath);
|
const portableConfigDir = path.dirname(execPath);
|
||||||
const portableConfigPath = path.join(portableConfigDir, portableConfigFileName);
|
const portableConfigPath = path.join(portableConfigDir, portableConfigFileName);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('Portable config path:', portableConfigPath);
|
||||||
|
|
||||||
if (fs.existsSync(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 portableConfig = JSON.parse(fs.readFileSync(portableConfigPath, 'utf8'));
|
||||||
const portableUserDataDir = path.resolve(portableConfigDir, portableConfig.userDataDir);
|
const portableUserDataDir = path.resolve(portableConfigDir, portableConfig.userDataDir);
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log('Portable user data dir:', portableUserDataDir);
|
||||||
|
|
||||||
if (!fs.existsSync(portableUserDataDir)) {
|
if (!fs.existsSync(portableUserDataDir)) {
|
||||||
fs.mkdirSync(portableUserDataDir);
|
fs.mkdirSync(portableUserDataDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
app.setPath('userData', portableUserDataDir);
|
app.setPath('userData', portableUserDataDir);
|
||||||
usingPortableUserDataDir = true;
|
usingPortableUserDataDir = true;
|
||||||
|
} else {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.log(`Portable config path doesn't exist`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue