update user data path to lookup for more specific path on Linux

This commit is contained in:
Brendan Forster 2017-07-24 17:42:42 -03:00
parent 01bbea9d99
commit ee5ff2b67a

View file

@ -102,11 +102,14 @@ function getUserDataPath() {
const home = os.homedir()
return path.join(home, 'Library', 'Application Support', getProductName())
} else if (process.platform === 'linux') {
if (process.env.XDG_CONFIG_HOME) {
return path.join(process.env.XDG_CONFIG_HOME, getProductName())
}
const home = os.homedir()
return path.join(home, '.' + getProductName())
return path.join(home, '.config', getProductName())
} else {
console.error(
`I dunno how to review for ${process.platform} ${process.arch} :(`
`I dunno how to resolve the user data path for ${process.platform} ${process.arch} :(`
)
process.exit(1)
}