1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Fixed appdata path error

This commit is contained in:
Hung Nguyen
2018-04-21 09:04:30 +07:00
parent 8925f7c381
commit 358458a937

View File

@@ -12,7 +12,15 @@ const themes = fs.readdirSync(themePath)
})
themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light')
const snippetFile = path.join(remote.app.getPath('appData'), 'Boostnote', 'snippets.json')
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'
: '/.config')
}
const consts = {
FOLDER_COLORS: [