Permalink
Browse files

depend on `os-homedir` ponyfill

  • Loading branch information...
1 parent 7469cb0 commit 88e09a102e6a3d211b01875a430833b509885a8b @sindresorhus committed Jun 13, 2015
Showing with 4 additions and 14 deletions.
  1. +1 −14 index.js
  2. +3 −0 package.json
View
@@ -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')();
View
@@ -33,6 +33,9 @@
"variables",
"userprofile"
],
+ "dependencies": {
+ "os-homedir": "^1.0.0"
+ },
"devDependencies": {
"ava": "0.0.4",
"path-exists": "^1.0.0"

0 comments on commit 88e09a1

Please sign in to comment.