Skip to content

Commit

Permalink
refactor ~ merge/simplify path construction calls
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed Feb 10, 2021
1 parent 88c7c80 commit 3c58a5d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib/XDG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,16 @@ const linux = () => {

const macos = () => {
const cache = () =>
process.env.XDG_CACHE_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Caches');
process.env.XDG_CACHE_HOME || path.join(osPaths.home() || osPaths.temp(), 'Library', 'Caches');
const config = () =>
process.env.XDG_CONFIG_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Preferences');
path.join(osPaths.home() || osPaths.temp(), 'Library', 'Preferences');
const data = () =>
process.env.XDG_DATA_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'Application Support');
path.join(osPaths.home() || osPaths.temp(), 'Library', 'Application Support');
const runtime = () => process.env.XDG_RUNTIME_DIR || void 0;
const state = () =>
process.env.XDG_STATE_HOME ||
path.join(path.join(osPaths.home() || osPaths.temp(), 'Library'), 'State');
process.env.XDG_STATE_HOME || path.join(osPaths.home() || osPaths.temp(), 'Library', 'State');

return { cache, config, data, runtime, state };
};
Expand Down

0 comments on commit 3c58a5d

Please sign in to comment.