Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
depend on os-homedir ponyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 13, 2015
1 parent 7469cb0 commit 88e09a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
15 changes: 1 addition & 14 deletions index.js
@@ -1,15 +1,2 @@
'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);
} else if (process.platform === 'linux') {
module.exports = home ||
(user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null);
} else {
module.exports = home || null;
}
module.exports = require('os-homedir')();
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -33,6 +33,9 @@
"variables",
"userprofile"
],
"dependencies": {
"os-homedir": "^1.0.0"
},
"devDependencies": {
"ava": "0.0.4",
"path-exists": "^1.0.0"
Expand Down

0 comments on commit 88e09a1

Please sign in to comment.