dotfiles/.vscode/extensions/saviorisdead.RustyCode-0.18.0/node_modules/user-home/index.js
Cyryl Płotnicki 2f946d6200 Add .vscode
2016-09-11 10:29:13 +02:00

15 lines
547 B
JavaScript

'use strict';
var env = process.env;
var home = env.HOME;
var user = env.LOGNAME || env.USER || env.LNAME || env.USERNAME;
if (process.platform === 'win32') {
module.exports = env.USERPROFILE || env.HOMEDRIVE + env.HOMEPATH || home || null;
} else if (process.platform === 'darwin') {
module.exports = home || (user ? '/Users/' + user : null) || null;
} else if (process.platform === 'linux') {
module.exports = home ||
(user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null) || null;
} else {
module.exports = home || null;
}