Skip to content

Commit

Permalink
Fixing Mist/Electron app paths
Browse files Browse the repository at this point in the history
  • Loading branch information
evertonfraga committed Dec 16, 2017
1 parent 3b0444c commit 27f3feb
Show file tree
Hide file tree
Showing 3 changed files with 601 additions and 49 deletions.
2 changes: 1 addition & 1 deletion modules/menuItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ let menuTempl = function (webviews) {
label: i18n.t('mist.applicationMenu.develop.logFiles'),
click() {
try {
shell.showItemInFolder(`${Settings.appDataPath}/Mist/logs/all.log`);
shell.showItemInFolder(path.join(Settings.userDataPath, 'logs', 'all.log'));
} catch (error) {
log.error(error);
}
Expand Down
6 changes: 4 additions & 2 deletions modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ if (argv.nodeOptions && argv.nodeOptions.syncmode) {
class Settings {
init() {
const logLevel = {logLevel: argv.loglevel};
const logFolder = {logFolder: `${this.appDataPath}/Mist/logs`};
const logFolder = {logFolder: path.join(this.userDataPath, 'logs')};
const loggerOptions = Object.assign(argv, logLevel, logFolder);
logger.setup(loggerOptions);
this._log = logger.create('Settings');
Expand Down Expand Up @@ -209,8 +209,10 @@ class Settings {
store.dispatch(syncBuildConfig('uiMode', this.uiMode));
}


// @returns "Application Support/Mist" in production mode
// @returns "Application Support/Electron" in development mode
get userDataPath() {
// Application Support/Mist
return app.getPath('userData');
}

Expand Down
Loading

0 comments on commit 27f3feb

Please sign in to comment.