mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Use sane location for config (#3584)
This commit is contained in:
parent
7d67b76715
commit
22b5bbb488
1 changed files with 6 additions and 1 deletions
|
|
@ -9,7 +9,12 @@ const cfgFile = '.hyper.js';
|
|||
const defaultCfgFile = 'config-default.js';
|
||||
const homeDirectory = homedir();
|
||||
|
||||
const applicationDirectory = app.getPath('userData');
|
||||
// If the user defines XDG_CONFIG_HOME they definitely want their config there,
|
||||
// otherwise use the home directory in linux/mac and userdata in windows
|
||||
const applicationDirectory =
|
||||
process.env.XDG_CONFIG_HOME !== undefined
|
||||
? join(process.env.XDG_CONFIG_HOME, 'hyper')
|
||||
: process.platform == 'win32' ? app.getPath('userData') : homedir();
|
||||
|
||||
let cfgPath = join(applicationDirectory, cfgFile);
|
||||
let cfgDir = applicationDirectory;
|
||||
|
|
|
|||
Loading…
Reference in a new issue