Skip to content

Commit

Permalink
refactor ~ reorganize properties
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Jun 29, 2019
1 parent 56677d3 commit f376e0c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ const macos = name => {
const library = path.join(homedir, 'Library');

return {
data: path.join(library, 'Application Support', name),
config: path.join(library, 'Preferences', name),
cache: path.join(library, 'Caches', name),
config: path.join(library, 'Preferences', name),
data: path.join(library, 'Application Support', name),
log: path.join(library, 'Logs', name),
temp: path.join(tmpdir, name)
};
Expand All @@ -24,9 +24,9 @@ const windows = name => {

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(appData, name, 'Config'),
cache: path.join(localAppData, name, 'Cache'),
config: path.join(appData, name, 'Config'),
data: path.join(localAppData, name, 'Data'),
log: path.join(localAppData, name, 'Log'),
temp: path.join(tmpdir, name)
};
Expand All @@ -37,9 +37,9 @@ const linux = name => {
const username = path.basename(homedir);

return {
data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name),
config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name),
cache: path.join(env.XDG_CACHE_HOME || path.join(homedir, '.cache'), name),
config: path.join(env.XDG_CONFIG_HOME || path.join(homedir, '.config'), name),
data: path.join(env.XDG_DATA_HOME || path.join(homedir, '.local', 'share'), name),
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
log: path.join(env.XDG_STATE_HOME || path.join(homedir, '.local', 'state'), name),
temp: path.join(tmpdir, username, name)
Expand Down

0 comments on commit f376e0c

Please sign in to comment.