Skip to content

Commit

Permalink
Use %APPDATA% for .config on Windows (#9)
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
sindresorhus committed Nov 5, 2018
1 parent 830630c commit a47befe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ const macos = name => {
};

const windows = name => {
const appData = env.APPDATA || path.join(homedir, 'AppData', 'Roaming');
const localAppData = env.LOCALAPPDATA || path.join(homedir, 'AppData', 'Local');

return {
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
data: path.join(localAppData, name, 'Data'),
config: path.join(localAppData, name, 'Config'),
config: path.join(appData, name, 'Config'),
cache: path.join(localAppData, name, 'Cache'),
log: path.join(localAppData, name, 'Log'),
temp: path.join(tmpdir, name)
Expand Down

0 comments on commit a47befe

Please sign in to comment.