diff --git a/browser/lib/consts.js b/browser/lib/consts.js index 2eb9bd39..197f7806 100644 --- a/browser/lib/consts.js +++ b/browser/lib/consts.js @@ -12,13 +12,13 @@ const themes = fs.readdirSync(themePath) }) themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light') -const snippetFile = process.env.NODE_ENV === 'production' +const snippetFile = process.env.NODE_ENV === 'production' ? path.join(app.getPath('appData'), 'Boostnote', 'snippets.json') : require('path').resolve(path.join(getAppData(), 'Boostnote', 'snippets.json')) function getAppData () { - return process.env.APPDATA || (process.platform == 'darwin' - ? process.env.HOME + 'Library/Preferences' + return process.env.APPDATA || (process.platform === 'darwin' + ? process.env.HOME + 'Library/Preferences' : '/.config') }