Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Fallback to os temp directory if findCacheDir fail #154

Merged
merged 3 commits into from
Feb 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var crypto = require("crypto")
var fs = require("fs")
var findCacheDir = require("find-cache-dir")
var objectHash = require("object-hash")
var os = require("os")

var engines = {}
var cache = null
Expand Down Expand Up @@ -165,7 +166,7 @@ module.exports = function(input, map) {
thunk: true,
create: true,
})
cachePath = thunk("data.json")
cachePath = thunk("data.json") || os.tmpdir() + "/data.json"
try {
cache = require(cachePath)
}
Expand Down