babel register cache: make sure the cache file's directory exists

This commit is contained in:
jongleberry
2016-01-04 14:28:38 -08:00
parent 2516b7570f
commit 37dbf7c5ed
2 changed files with 7 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import path from "path";
import fs from "fs";
import { sync as mkdirpSync } from "mkdirp";
import homeOrTmp from "home-or-tmp";
import pathExists from "path-exists";
@@ -22,6 +23,7 @@ export function save() {
throw err;
}
}
mkdirpSync(path.dirname(FILENAME));
fs.writeFileSync(FILENAME, serialised);
}