Skip to content

Commit

Permalink
Use sane location for config (#3584)
Browse files Browse the repository at this point in the history
  • Loading branch information
juancampa authored May 6, 2019
1 parent 7d67b76 commit 22b5bbb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 22b5bbb

Please sign in to comment.