From a47befed2af0d27f56d423cc97f5f420f4a5d431 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 5 Nov 2018 12:01:57 +0700 Subject: [PATCH] Use `%APPDATA%` for `.config` on Windows (#9) Fixes #8 --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 345b515..083d9c7 100644 --- a/index.js +++ b/index.js @@ -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)