Merge pull request #1203 from sindresorhus/modularize-userhome

modularize `user-home`
This commit is contained in:
Sebastian McKenzie 2015-04-08 09:49:03 -07:00
commit 0be6fd7abe
2 changed files with 4 additions and 6 deletions

View File

@ -55,7 +55,8 @@
"source-map-support": "^0.2.9",
"strip-json-comments": "^1.0.2",
"to-fast-properties": "^1.0.0",
"trim-right": "^1.0.0"
"trim-right": "^1.0.0",
"user-home": "^1.1.1"
},
"devDependencies": {
"babel": "4.7.13",

View File

@ -1,12 +1,9 @@
import path from "path";
import os from "os";
import fs from "fs";
import userHome from "user-home";
function getUserHome() {
return process.env.HOME || process.env.USERPROFILE;
}
const FILENAME = process.env.BABEL_CACHE_PATH || path.join(getUserHome() || os.tmpdir(), ".babel.json");
const FILENAME = process.env.BABEL_CACHE_PATH || path.join(userHome || os.tmpdir(), ".babel.json");
var data = {};
export function save() {