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

removed redundant function to get appdata

This commit is contained in:
Nguyễn Việt Hưng
2018-05-02 09:05:29 +07:00
parent 106f5a53ff
commit 2bc0bce1b5

View File

@@ -13,15 +13,9 @@ 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 !== 'test'
? path.join(app.getPath('appData'), 'Boostnote', 'snippets.json')
: path.join(getAppData(), 'Boostnote', 'snippets.json')
function getAppData () {
return process.env.APPDATA || (process.platform === 'darwin'
? path.join(process.env.HOME, 'Library', 'Preferences')
: path.join(os.homedir(), '.config'))
}
: '' // return nothing as we specified different path to snippets.json in test
const consts = {
FOLDER_COLORS: [