use users home directory to store babel/register cache - fixes #1093

This commit is contained in:
Sebastian McKenzie 2015-03-31 01:40:53 +11:00
parent 59e07b65dd
commit 2f25c3bd17
2 changed files with 5 additions and 2 deletions

View File

@ -64,7 +64,6 @@
"slash": "^1.0.0",
"source-map": "^0.4.0",
"source-map-support": "^0.2.9",
"tmp": "0.0.25",
"to-fast-properties": "^1.0.0",
"trim-right": "^1.0.0"
},

View File

@ -2,7 +2,11 @@ import path from "path";
import os from "os";
import fs from "fs";
const FILENAME = process.env.BABEL_CACHE_PATH || path.join(os.tmpdir(), "babel.json");
function getUserHome() {
return process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE;
}
const FILENAME = process.env.BABEL_CACHE_PATH || path.join(getUserHome() || os.tmpdir(), "babel.json");
var data = {};
export function save() {