1 const { app } = require('electron')
2 const path = require('path')
3 const glob = require('glob')
5 // import logger from './logger'
19 // const logLevel = { logLevel: 'info' }
20 // const logFolder = { logFolder: path.join(this.userDataPath, 'logs') }
21 // const loggerOptions = Object.assign('info', logLevel, logFolder)
22 // logger.setup(loggerOptions)
26 return app.getPath('userData')
30 // Application Support/
31 return app.getPath('appData')
35 return app.getPath('home')
39 return process.env.DEV?
40 path.join(__dirname, '../bytomd/bytomd-darwin_amd64'):
41 glob.sync( path.join(__dirname, '../../bytomd/bytomd*'))
46 switch (process.platform){
48 bytomdDataPath = `${app.getPath('appData')}/Bytom`
51 bytomdDataPath = `${app.getPath('home')}/Library/Application Support/Bytom`
54 bytomdDataPath = `${app.getPath('home')}/.bytom`
59 constructUserDataPath(filePath) {
60 return path.join(this.userDataPath, filePath)
64 module.exports = new Settings()