From 2bc0bce1b5368cb5d91192048fc19289802cc211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Vi=E1=BB=87t=20H=C6=B0ng?= Date: Wed, 2 May 2018 09:05:29 +0700 Subject: [PATCH] removed redundant function to get appdata --- browser/lib/consts.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/browser/lib/consts.js b/browser/lib/consts.js index 3d414a14..3837ef44 100644 --- a/browser/lib/consts.js +++ b/browser/lib/consts.js @@ -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: [