1 const { app } = require('electron')
2 const path = require('path')
4 import logger from './logger'
18 const logLevel = { logLevel: 'info' }
19 const logFolder = { logFolder: path.join(this.userDataPath, 'logs') }
20 const loggerOptions = Object.assign('info', logLevel, logFolder)
21 logger.setup(loggerOptions)
25 return app.getPath('userData')
29 // Application Support/
30 return app.getPath('appData')
34 return app.getPath('home')
38 return process.env.DEV?
39 path.join(__dirname, '../bytomd/bytomd-darwin_amd64'):
40 glob.sync( path.join(__dirname, '../bytomd/bytomd*'))
45 switch (process.platform){
47 bytomdDataPath = `${app.getPath('appData')}/Bytom`
50 bytomdDataPath = `${app.getPath('home')}/Library/Application Support/Bytom`
53 bytomdDataPath = `${app.getPath('home')}/.bytom`
58 constructUserDataPath(filePath) {
59 return path.join(this.userDataPath, filePath)
63 module.exports = new Settings()