.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / xdg-basedir / index.js
1 'use strict';
2 const os = require('os');
3 const path = require('path');
4
5 const home = os.homedir();
6 const env = process.env;
7
8 exports.data = env.XDG_DATA_HOME ||
9         (home ? path.join(home, '.local', 'share') : null);
10
11 exports.config = env.XDG_CONFIG_HOME ||
12         (home ? path.join(home, '.config') : null);
13
14 exports.cache = env.XDG_CACHE_HOME || (home ? path.join(home, '.cache') : null);
15
16 exports.runtime = env.XDG_RUNTIME_DIR || null;
17
18 exports.dataDirs = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
19
20 if (exports.data) {
21         exports.dataDirs.unshift(exports.data);
22 }
23
24 exports.configDirs = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
25
26 if (exports.config) {
27         exports.configDirs.unshift(exports.config);
28 }