mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
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')
|
|
: require('path').resolve('./node_modules/codemirror/theme')
|
|
const themes = fs.readdirSync(themePath)
|
|
.map((themePath) => {
|
|
return themePath.substring(0, themePath.lastIndexOf('.'))
|
|
})
|
|
themes.splice(themes.indexOf('solarized'), 1, 'solarized dark', 'solarized light')
|
|
|
|
const snippetFile = process.env.NODE_ENV === 'production'
|
|
? path.join(app.getPath('appData'), 'Boostnote', 'snippets.json')
|
|
: path.join(getAppData(), 'Boostnote', 'snippets.json')
|
|
|
|
function getAppData () {
|
|
return process.env.APPDATA || (process.platform === 'darwin'
|
|
? process.env.HOME + 'Library' + path.sep + 'Preferences'
|
|
: require('os').homedir() + path.sep + '.config')
|
|
}
|
|
|
|
const consts = {
|
|
FOLDER_COLORS: [
|
|
'#E10051',
|
|
'#FF8E00',
|
|
'#E8D252',
|
|
'#3FD941',
|
|
'#30D5C8',
|
|
'#2BA5F7',
|
|
'#B013A4'
|
|
],
|
|
FOLDER_COLOR_NAMES: [
|
|
'Razzmatazz (Red)',
|
|
'Pizazz (Orange)',
|
|
'Confetti (Yellow)',
|
|
'Emerald (Green)',
|
|
'Turquoise',
|
|
'Dodger Blue',
|
|
'Violet Eggplant'
|
|
],
|
|
THEMES: ['default'].concat(themes),
|
|
SNIPPET_FILE: snippetFile
|
|
}
|
|
|
|
module.exports = consts
|