Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't forget nightly when computing userData path #120

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/electron-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,18 @@ if (userDataPathInProtocol) {
} else if (argv['profile-dir']) {
userDataPath = argv['profile-dir'];
} else {
// strip the bracketed riot suffix from the app name, if any: we don't want to
// store user data in a dir with that transitional suffix.
const appName = app.getName().replace(' (Riot)', '');

// always override the user data path because electron uses the ${appData}/productName
// but we want our productName to be "Element (Riot)" for a transition period after the rename.
let newUserDataPath = path.join(app.getPath('appData'), 'Element');
let newUserDataPath = path.join(app.getPath('appData'), appName);
if (argv['profile']) {
newUserDataPath += '-' + argv['profile'];
}
const newUserDataPathExists = isRealUserDataDir(newUserDataPath);
const oldUserDataPath = path.join(app.getPath('appData'), 'Riot');
const oldUserDataPath = path.join(app.getPath('appData'), appName.replace('Element', 'Riot'));
const oldUserDataPathExists = isRealUserDataDir(oldUserDataPath);
console.log(newUserDataPath + " exists: " + (newUserDataPathExists ? 'yes' : 'no'));
console.log(oldUserDataPath + " exists: " + (oldUserDataPathExists ? 'yes' : 'no'));
Expand Down