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

updated lib/consts to access electron remote.app only when in production mode

This commit is contained in:
Yu-Hung Ou
2018-03-11 23:17:14 +11:00
parent 3cba71b7a8
commit bbcd674516

View File

@@ -1,10 +1,9 @@
const path = require('path')
const fs = require('sander')
const { remote } = require('electron')
const { app } = remote
const themePath = process.env.NODE_ENV === 'production'
? path.join(app.getAppPath(), './node_modules/codemirror/theme')
? path.join(remote.app.getAppPath(), './node_modules/codemirror/theme')
: require('path').resolve('./node_modules/codemirror/theme')
const themes = fs.readdirSync(themePath)
.map((themePath) => {